def check_key(user, key, enc, comment, options, config='.ssh/authorized_keys', cache_keys=None):
 if (cache_keys is None):
  cache_keys = []
 enc = _refine_enc(enc)
 current = auth_keys(user, config)
 nline = _format_auth_line(key, enc, comment, options)
 if (key in current):
  cline = _format_auth_line(key, current[key]['enc'], current[key]['comment'], current[key]['options'])
  if (cline != nline):
   return 'update'
 else:
  return 'add'
 return 'exists'

def check_key ( user , key , enc , comment , options , config = '.ssh/authorized_keys' , cache_keys = None ) : if ( cache_keys is None ) : cache_keys = [ ] enc = _refine_enc ( enc ) current = auth_keys ( user , config ) nline = _format_auth_line ( key , enc , comment , options ) if ( key in current ) : cline = _format_auth_line ( key , current [ key ] [ 'enc' ] , current [ key ] [ 'comment' ] , current [ key ] [ 'options' ] ) if ( cline != nline ) : return 'update' else : return 'add' return 'exists'
check to see if a key needs updating .