Describe the bug
When cleaning up systems after maintenance, already removed snapshots cannot be removed. An exception is thrown.
To Reproduce
Steps to reproduce the behavior:
Prepare system maintenance
Manually remove a system's snapshot
Run katprep_maintenance errata-snapshot*.json cleanup
Expected behavior
A warning should be displayed, e.g. Snapshot $xyz for $hostname was already removed.
The execution should continue.
Environment (please complete the following information):
OS version: CentOS 7.4
Red Hat Satellite or Foreman/Katello version: Foreman 1.17.1 and Katello 3.6.0, but this also applies to other versions
Additional context
$ katprep_maintenance -C container.auth errata-snapshot-report-giertz-20180721-1000.json -I dev -K cleanup
Authentication container password:
WARNING:katprep_maintenance:You decided to skip scheduling downtimes - happy flodding!
Traceback (most recent call last):
File "/home/stdevel/.local/bin/katprep_maintenance", line 9, in <module>
load_entry_point('katprep==0.5.0', 'console_scripts', 'katprep_maintenance')()
File "/home/stdevel/katprep/katprep/maintenance.py", line 877, in cli
main(options, args)
File "/home/stdevel/katprep/katprep/maintenance.py", line 856, in main
options.func(options, options.func)
File "/home/stdevel/katprep/katprep/maintenance.py", line 542, in cleanup
manage_host_preparation(options, host, True)
File "/home/stdevel/katprep/katprep/maintenance.py", line 137, in manage_host_preparation
vm_name, "katprep_{}".format(REPORT_PREFIX)
File "/home/stdevel/katprep/katprep/clients/PyvmomiClient.py", line 218, in remove_snapshot
vm_name, snapshot_title, "", action="remove"
File "/home/stdevel/katprep/katprep/clients/PyvmomiClient.py", line 137, in __manage_snapshot
snapshots = self.__get_snapshots(vm_name)
File "/home/stdevel/katprep/katprep/clients/PyvmomiClient.py", line 255, in __get_snapshots
raise EmptySetException("No snapshots found")
katprep.clients.EmptySetException: No snapshots found
Describe the bug When cleaning up systems after maintenance, already removed snapshots cannot be removed. An exception is thrown.
To Reproduce Steps to reproduce the behavior:
katprep_maintenance errata-snapshot*.json cleanup
Expected behavior A warning should be displayed, e.g. Snapshot $xyz for $hostname was already removed. The execution should continue.
Environment (please complete the following information):
Additional context