--- a/cwctl.py Fri Oct 16 17:11:31 2009 +0200
+++ b/cwctl.py Fri Oct 16 17:11:44 2009 +0200
@@ -774,13 +774,17 @@
config.set_sources_mode(sources)
config.repairing = self.config.force
mih = config.migration_handler()
- if args:
- for arg in args:
- mih.process_script(arg)
- else:
- mih.interactive_shell()
- if not self.config.pyro:
- mih.shutdown()
+ try:
+ if args:
+ for arg in args:
+ mih.process_script(arg)
+ else:
+ mih.interactive_shell()
+ finally:
+ if not self.config.pyro:
+ mih.shutdown()
+ else:
+ cnx.close()
class RecompileInstanceCatalogsCommand(InstanceCommand):