When I use the command as follows to build from vmdk, I get an error shows no such file.
ova-compose -i /photon.yaml -o /src/photon-ova.ova --param disk0=/src/ova/photon-ova0.vmdk
Traceback (most recent call last):
File "/usr/bin/ova-compose", line 1363, in <module>
main()
File "/usr/bin/ova-compose", line 1299, in main
ovf = OVF.from_dict(config)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/bin/ova-compose", line 958, in from_dict
disk = OVFDisk(hw['disk_image'],
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/bin/ova-compose", line 605, in __init__
self.file = OVFFile(path)
^^^^^^^^^^^^^
File "/usr/bin/ova-compose", line 542, in __init__
self.size = os.path.getsize(self.path)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen genericpath>", line 50, in getsize
FileNotFoundError: [Errno 2] No such file or directory: 'photon-ova0.vmdk'
Reproduction steps
ova-compose --param disk0={SOME_PATH}
Expected behavior
Build successfully.
Additional context
I believe this is because we should not use a basename here:
class OVFFile(object):
next_id = 0
def __init__(self, path, file_id=None):
self.path = os.path.basename(path)
if file_id is None:
self.id = f"file{OVFFile.next_id}"
OVFFile.next_id += 1
else:
self.id = file_id
self.size = os.path.getsize(self.path)
Describe the bug
When I use the command as follows to build from vmdk, I get an error shows
no such file
.Reproduction steps
Expected behavior
Build successfully.
Additional context
I believe this is because we should not use a
basename
here: