def __generate_key(self, config):
        """
        Generate the ssh key, and return the ssh config location
        """
        cwd = config.get('ssh_path', self._install_directory())
        if config.is_affirmative('create', default="yes"):
            if not os.path.exists(cwd):
                os.makedirs(cwd)
            if not os.path.exists(os.path.join(cwd, config.get('keyname'))):
                command = "ssh-keygen -t %(type)s -f %(keyname)s -N  " % config.to_dict()
                lib.call(command, cwd=cwd, output_log_level=logging.DEBUG)
        if not config.has('ssh_path'):
            config.set('ssh_path', cwd)
        config.set('ssh_key_path', os.path.join(config.get('ssh_path'), config.get('keyname')))
def __generate_key ( self , config ) : cwd = config . get ( 'ssh_path' , self . _install_directory ( ) ) if config . is_affirmative ( 'create' , default = "yes" ) : if not os . path . exists ( cwd ) : os . makedirs ( cwd ) if not os . path . exists ( os . path . join ( cwd , config . get ( 'keyname' ) ) ) : command = "ssh-keygen -t %(type)s -f %(keyname)s -N  " % config . to_dict ( ) lib . call ( command , cwd = cwd , output_log_level = logging . DEBUG ) if not config . has ( 'ssh_path' ) : config . set ( 'ssh_path' , cwd ) config . set ( 'ssh_key_path' , os . path . join ( config . get ( 'ssh_path' ) , config . get ( 'keyname' ) ) )
Generate the ssh key, and return the ssh config location