If remove_instance isn't passed to the Opcode, it'll be None.  When
generating the hooks environment, the error “int() argument must be a
string or a number” was raised. It should now behave as any other
boolean hook env variable.

Signed-off-by: Michael Hanselmann <[email protected]>
---
 lib/cmdlib.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 142a012..b721cd4 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -8097,7 +8097,8 @@ class LUExportInstance(LogicalUnit):
       "EXPORT_NODE": self.op.target_node,
       "EXPORT_DO_SHUTDOWN": self.op.shutdown,
       "SHUTDOWN_TIMEOUT": self.shutdown_timeout,
-      "REMOVE_INSTANCE": int(self.remove_instance),
+      # TODO: Generic function for boolean env variables
+      "REMOVE_INSTANCE": str(bool(self.remove_instance)),
       }
     env.update(_BuildInstanceHookEnvByObject(self, self.instance))
     nl = [self.cfg.GetMasterNode(), self.instance.primary_node,
-- 
1.6.6

Reply via email to