from .xlate import XLATOR
-__version__ = '0.2.1'
+__version__ = '0.2.2'
LOG = logging.getLogger(__name__)
cmds.append(c)
ssh = None
+ proc = None
try:
proc = CompletedProcess(cmds, retcode, output, err, start_dt=start_dt, end_dt=end_dt)
- if self.verbose > 2:
- LOG.debug(_("Completed SSH process:") + "\n{}".format(proc))
- return proc
+ finally:
+ if ssh:
+ if self.verbose > 2:
+ LOG.debug(_("Closing SSH connection."))
+ ssh.close()
+
+ if self.verbose > 2:
+ LOG.debug(_("Completed SSH process:") + "\n{}".format(proc))
+ return proc
# -------------------------------------------------------------------------
def get_cobbler_version(self):