# HG changeset patch # User Sylvain Thénault # Date 1255705904 -7200 # Node ID e67ade20bf802d57ae720c647ed18241c62da11a # Parent 95e8c3a9698a813c43d5a9b02efb83702846ae97 properly close remote connections diff -r 95e8c3a9698a -r e67ade20bf80 cwctl.py --- 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):