This should be a little cleaner, perhaps a tiny performance improvement,
and most importantly work better with the virtual-fs provided for the
unit tests and make this function more testable in the future.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
os.rename(data_dir,
os.path.join(backup_dir, dirname))
else:
- call_throws(ctx, ['rm', '-rf', data_dir])
+ shutil.rmtree(data_dir, ignore_errors=True)
endpoints = fetch_endpoints(ctx)
ports: List[int] = [e.port for e in endpoints]