1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

VMware: fix path for hw_files (#49116)

Fixes: #48929

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2019-02-04 12:02:55 +05:30 committed by GitHub
parent 449b7e9f10
commit d37386d2c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -314,11 +314,12 @@ def gather_vm_facts(content, vm):
facts['hw_files'] = [files.vmPathName] facts['hw_files'] = [files.vmPathName]
for item in layout.snapshot: for item in layout.snapshot:
for snap in item.snapshotFile: for snap in item.snapshotFile:
facts['hw_files'].append(files.snapshotDirectory + snap) if 'vmsn' in snap:
facts['hw_files'].append(snap)
for item in layout.configFile: for item in layout.configFile:
facts['hw_files'].append(os.path.dirname(files.vmPathName) + '/' + item) facts['hw_files'].append(os.path.join(os.path.dirname(files.vmPathName), item))
for item in vm.layout.logFile: for item in vm.layout.logFile:
facts['hw_files'].append(files.logDirectory + item) facts['hw_files'].append(os.path.join(files.logDirectory, item))
for item in vm.layout.disk: for item in vm.layout.disk:
for disk in item.diskFile: for disk in item.diskFile:
facts['hw_files'].append(disk) facts['hw_files'].append(disk)