Commit 895eb320 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

LUExportInstance: Remove instance only if export was successful



Until now, the instance was always removed (if asked for by the
user). In case of export errors however, it shouldn't.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 31ff0247
......@@ -8978,8 +8978,13 @@ class LUExportInstance(LogicalUnit):
# Remove instance if requested
if self.remove_instance:
feedback_fn("Removing instance %s" % instance.name)
_RemoveInstance(self, feedback_fn, instance, self.ignore_remove_failures)
if not (compat.all(dresults) and fin_resu):
feedback_fn("Not removing instance %s as parts of the export failed" %
instance.name)
else:
feedback_fn("Removing instance %s" % instance.name)
_RemoveInstance(self, feedback_fn, instance,
self.ignore_remove_failures)
self._CleanupExports(feedback_fn)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment