VMware: fix path for hw_files (#49116)

Fixes: #48929

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/51689/head
Abhijeet Kasurde 6 years ago committed by GitHub
parent 449b7e9f10
commit d37386d2c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save