Created attachment 1584770 [details] executor.log Description of problem: ffwd-prepare fails with WorkflowActionError: Action tripleo.parameters.update execution failed: 400 Client Error: Bad Request for url: http://192.168.10.253:8080/home/stack/my_templates/network/scripts/run-os-net-config.sh The issue is in get_file `/usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh` was getting hardcoded. ~~~ OsNetConfigImpl: type: OS::Heat::SoftwareConfig properties: group: script config: str_replace: template: get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh ~~~ After we changed this to below the `ffwd-upgrade prepare` worked fine: ~~~ OsNetConfigImpl: type: OS::Heat::SoftwareConfig properties: group: script config: str_replace: template: get_file: ../network/scripts/run-os-net-config.sh ~~~ To be noted the config file was not generated manually but by yaml-nic-config-2-script.py The issue is yaml-nic-config-2-script.py hardcode `/usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh` even if I am passing --script-dir Version-Release number of selected component (if applicable): How reproducible: Always when a custom template dir is used for deoployment Steps to Reproduce: # /usr/share/openstack-tripleo-heat-templates/tools/yaml-nic-config-2-script.py --script-dir /home/stack/newtemp/ /home/stack/virt/network/three-nics-vlans/legacy/compute.yaml Using script at /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh The yaml file will be overwritten and the original saved as /home/stack/virt/network/three-nics-vlans/legacy/compute.yaml.20190626070510 Overwrite /home/stack/virt/network/three-nics-vlans/legacy/compute.yaml? [y/n] y Converting /home/stack/virt/network/three-nics-vlans/legacy/compute.yaml grep -i get_file /home/stack/virt/network/three-nics-vlans/legacy/compute.yaml get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh After this ffwd-prepare fails. Actual results: yaml-nic-config-2-script.py is hard coding the path and as a result ffwd-upgrade prepare fails. Expected results: yaml-nic-config-2-script.py should use relative path when --script-dir is used. Additional info: I see a similar bugreport where `--script-dir` option was suggested but that is not helping either.
(In reply to Shatadru Bandyopadhyay from comment #0) > Steps to Reproduce: > > # > /usr/share/openstack-tripleo-heat-templates/tools/yaml-nic-config-2-script.py --script-dir /home/stack/newtemp/ /home/stack/virt/network/three-nics-vlans/legacy/compute.yaml ? That's not a path to run-os-net-config.sh, it's a path to a directory. parser.add_argument('--script-dir', metavar='<script directory>', help="Relative path to run-os-net-config.sh", default="network/scripts/run-os-net-config.sh") It's supposed to take a relative path to the actual script. Some examples: With a structure similar to what you find in THT, it just works ############################################################### $ tree . └── network ├── config │ └── multiple-nics │ └── compute.yaml └── scripts └── run-os-net-config.sh $ /tmp/bz1724165/tripleo-heat-templates/tools/yaml-nic-config-2-script.py network/config/multiple-nics/compute.yaml Using script at ../../scripts/run-os-net-config.sh The yaml file will be overwritten and the original saved as /tmp/bz1724165/newtemp/network/config/multiple-nics/compute.yaml.20190709214724 Overwrite network/config/multiple-nics/compute.yaml? [y/n] y Converting network/config/multiple-nics/compute.yaml $ grep -i get_file network/config/multiple-nics/compute.yaml get_file: ../../scripts/run-os-net-config.sh To use a different path for the run-os-net-config.sh script you need to specify a path relative to the nic config file itself ############################################################################################################################# For example: [hjensas@floke newtemp2]$ tree . ├── nic-configs │ └── compute.yaml └── script └── run-os-net-config.sh 2 directories, 2 files $ /tmp/bz1724165/tripleo-heat-templates/tools/yaml-nic-config-2-script.py --script-dir ../script/run-os-net-config.sh nic-configs/compute.yaml ^^ relative location looking from ^^ Using script at ../script/run-os-net-config.sh The yaml file will be overwritten and the original saved as /tmp/bz1724165/newtemp2/nic-configs/compute.yaml.20190709221457 Overwrite nic-configs/compute.yaml? [y/n] y Converting nic-configs/compute.yaml $ grep -i get_file nic-configs/compute.yaml get_file: ../script/run-os-net-config.sh NOTE, you can also use an absolute path, for example: $ tree . └── nic-configs └── compute.yaml $ /tmp/bz1724165/tripleo-heat-templates/tools/yaml-nic-config-2-script.py --script-dir /tmp/bz1724165/tripleo-heat-templates/network/scripts/run-os-net-config.sh nic-configs/compute.yaml Using script at /tmp/bz1724165/tripleo-heat-templates/network/scripts/run-os-net-config.sh The yaml file will be overwritten and the original saved as /tmp/bz1724165/newtemp2/nic-configs/compute.yaml.20190709221845 Overwrite nic-configs/compute.yaml? [y/n] y Converting nic-configs/compute.yaml $ grep -i get_file nic-configs/compute.yaml get_file: /tmp/bz1724165/tripleo-heat-templates/network/scripts/run-os-net-config.sh
Push change to add ../network/scripts/ to the search path.
Upstream change approved, waiting for it to merge so I can backport.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:0769