Bug 1572990

Summary: hard-coded path to run-os-net-config.sh after converting the nic-configs with yaml-nic-config-2-script.py
Product: Red Hat OpenStack Reporter: Udi Kalifon <ukalifon>
Component: openstack-tripleo-heat-templatesAssignee: Emilien Macchi <emacchi>
Status: CLOSED NOTABUG QA Contact: Gurenko Alex <agurenko>
Severity: high Docs Contact:
Priority: unspecified    
Version: 13.0 (Queens)CC: aschultz, bfournie, mburns
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-01 00:54:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Udi Kalifon 2018-04-29 13:59:45 UTC
Description of problem:
I converted my nic-configs and updated the swift plan. The GUI stopped working and kept giving me this error:

Deployment parameters could not be loaded

400 Client Error: Bad Request for url: https://puma01.scl.lab.tlv.redhat.com:13808/usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh

You can see from the error message that the path to the file is absolute, and not relative to the plan. The path should just be "network/scripts/run-os-net-config.sh".

Looking in the converted nic-configs, I see this:
get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh

The path should have been relative...


Version-Release number of selected component (if applicable):
openstack-tripleo-heat-templates-8.0.2-0.20180414062830.5f869f2.el7ost.noarch


How reproducible:
100%


Steps to Reproduce:
1. Convert your nic-configs from OSP12: /usr/share/openstack-tripleo-heat-templates/tools/yaml-nic-config-2-script.py <<nic-config-file>>
2. Look for absolute paths in the converted file


Actual results:
There are absolute path in the file, which will only work if you deploy from the CLI but not for GUI users


Expected results:
Paths should be relative and point inside the plans

Comment 1 Bob Fournier 2018-05-01 00:54:07 UTC
The script takes an optional parameter to define a relative path for the script file.
By default it will use an absolute path but if you want a relative just define it using --script-dir when using the script.

$ /usr/share/openstack-tripleo-heat-templates/tools/yaml-nic-config-2-script.py --help
usage: yaml-nic-config-2-script.py [-h] [--script-dir <script directory>]
                                   <file> [<file> ...]

Convert an old style NIC config file into the new format using run-os-net-
config.sh

positional arguments:
  <file>                List of one or more NIC config files to convert

optional arguments:
  -h, --help            show this help message and exit
  --script-dir <script directory>
                        Relative path to run-os-net-config.sh