def _parse_openssh_output(lines):
 for line in lines:
  if line.startswith('#'):
   continue
  try:
   (hostname, enc, key) = line.split()
  except ValueError:
   continue
  fingerprint = _fingerprint(key)
  if (not fingerprint):
   continue
  (yield {'hostname': hostname, 'key': key, 'enc': enc, 'fingerprint': fingerprint})

def _parse_openssh_output ( lines ) : for line in lines : if line . startswith ( '#' ) : continue try : ( hostname , enc , key ) = line . split ( ) except ValueError : continue fingerprint = _fingerprint ( key ) if ( not fingerprint ) : continue ( yield { 'hostname' : hostname , 'key' : key , 'enc' : enc , 'fingerprint' : fingerprint } )
helper function which parses ssh-keygen -f and ssh-keyscan function output and yield dict with keys information .