'Called whenever a slave SSH connection needs to be initiated (e.g., by
run, rsync, scp). If master SSH support is enabled and a master SSH
connection is not active already, start a new one in the background.
Also, cleanup any zombie master SSH connections (e.g., dead due to
reboot).'

def start_master_ssh(self):

    if (not enable_master_ssh):
        return
    if (self.master_ssh_job is not None):
        if (self.master_ssh_job.sp.poll() is not None):
            logging.info('Master    ssh    connection    to    %s    is    down.', self.hostname)
            self._cleanup_master_ssh()
    if (self.master_ssh_job is None):
        self.master_ssh_tempdir = autotemp.tempdir(unique_id='ssh-master')
        self.master_ssh_option = ('-o    ControlPath=%s/socket' % self.master_ssh_tempdir.name)
        master_cmd = self.ssh_command(options='-N    -o    ControlMaster=yes')
        logging.info(("Starting    master    ssh    connection    '%s'" % master_cmd))
        self.master_ssh_job = utils.BgJob(master_cmd)
