Incorrect path to user data file in "pkggen.py"

Bug #2074332 reported by Ai Hamano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Undecided
Ai Hamano

Bug Description

When trying to create a VNF package using the following "pkggen.py", an error occurs and it cannot be created.
* https://opendev.org/openstack/tacker/src/branch/stable/2024.1/samples/tests/functional/sol_v2_common/basic_lcms_max_individual_vnfc/pkggen.py

[Operation]
```
$ export PYTHONPATH=/opt/stack/tacker
$ cd /opt/stack/tacker/samples/tests/functional/sol_v2_common/basic_lcms_max_individual_vnfc
$ python3 pre.py
$ python3 pkggen.py
Traceback (most recent call last):
  File "/opt/stack/tacker/samples/tests/functional/sol_v2_common/basic_lcms_max_individual_vnfc/pkggen.py", line 41, in
<module>
    utils.make_zip(".", tmp_dir, vnfd_id, image_path=image_path,
  File "/opt/stack/tacker/tacker/tests/functional/sol_v2_common/utils.py", line 64, in make_zip
    shutil.copy(userdata_path, file_path)
  File "/usr/lib/python3.10/shutil.py", line 417, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.10/shutil.py", line 254, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory:
'/opt/stack/tacker/samples/tacker/sol_refactored/infra_drivers/openstack/userdata_standard.py'
```

This is because the path to userdata_standard.py specified in pkggen.py is incorrect.
* https://opendev.org/openstack/tacker/src/branch/stable/2024.1/samples/tests/functional/sol_v2_common/basic_lcms_max_individual_vnfc/pkggen.py#L36-L37

It is necessary to correct it as follows.
```
# samples/tests/functional/sol_v2_common/sampleX
userdata_dir = "../../../../../tacker/sol_refactored/infra_drivers/openstack/"
```

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/tacker/+/925076

Changed in tacker:
status: New → In Progress
Ai Hamano (haman0)
Changed in tacker:
assignee: nobody → Ai Hamano (haman0)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.opendev.org/c/openstack/tacker/+/925076
Committed: https://opendev.org/openstack/tacker/commit/6e9bfa93c7d737aca0e954dae468027e85ad673d
Submitter: "Zuul (22348)"
Branch: master

commit 6e9bfa93c7d737aca0e954dae468027e85ad673d
Author: Ai Hamano <email address hidden>
Date: Mon Jul 29 14:35:57 2024 +0900

    Fix incorrect file path in pkggen.py

    This patch fixes the path to userdata_standard.py and
    container_update_mgmt_v2.py specified in pkggen.py
    to the correct one below.

    * userdata_standard.py
    ```
    # samples/tests/functional/sol_v2_common/sampleX
    userdata_dir =
    "../../../../../tacker/sol_refactored/infra_drivers/openstack/"
    ```

    * container_update_mgmt_v2.py
    ```
    mgmt_driver_path = os.path.join(
        cur_dir, '../../../../../tacker/sol_refactored',
        'mgmt_drivers/container_update_mgmt_v2.py')
    ```

    Closes-Bug: #2074332
    Change-Id: Iea5d417bba0e1f9a6518df59ced77d6e50ba34de

Changed in tacker:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.