def gen_key(path):
 cmd = 'ssh-keygen -P "" -f {0} -t rsa -q'.format(path)
 if (not os.path.isdir(os.path.dirname(path))):
  os.makedirs(os.path.dirname(path))
 subprocess.call(cmd, shell=True)

def gen_key ( path ) : cmd = 'ssh-keygen -P "" -f {0} -t rsa -q' . format ( path ) if ( not os . path . isdir ( os . path . dirname ( path ) ) ) : os . makedirs ( os . path . dirname ( path ) ) subprocess . call ( cmd , shell = True )
generate a key for use with salt-ssh .