Bug 1572990 - hard-coded path to run-os-net-config.sh after converting the nic-configs with yaml-nic-config-2-script.py
Summary: hard-coded path to run-os-net-config.sh after converting the nic-configs with...
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 13.0 (Queens)
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Emilien Macchi
QA Contact: Gurenko Alex
Depends On:
TreeView+ depends on / blocked
Reported: 2018-04-29 13:59 UTC by Udi
Modified: 2018-05-01 00:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-05-01 00:54:07 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Udi 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):

How reproducible:

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-

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

Note You need to log in before you can comment on or make changes to this bug.