parameters: (self, name)
docstring: Removes the identity associated with *name*.  For example if *name* is
      'testkey', 'testkey' and 'testkey.pub' would be removed from the user's
      ssh directory (and 'testkey-cert.pub' if present).
docstring_summary: Removes the identity associated with *name*.  For example if *name* is
      'testkey', 'testkey' and 'testkey.pub' would be removed from the user's
      ssh directory (and 'testkey-cert.pub' if present).
docstring_tokens: Removes the identity associated with * name * . For example if * name * is testkey testkey and testkey . pub would be removed from the user s ssh directory ( and testkey - cert . pub if present ) .
function: def delete_identity(self, name):
      """
      Removes the identity associated with *name*.  For example if *name* is
      'testkey', 'testkey' and 'testkey.pub' would be removed from the user's
      ssh directory (and 'testkey-cert.pub' if present).
      """
      self.ssh_log.info(
          'Deleting SSH identity: %s' % name, metadata={'name': name})
      out_dict = {'result': 'Success'}
      users_ssh_dir = get_ssh_dir(self)
      private_key_path = os.path.join(users_ssh_dir, name)
      public_key_path = os.path.join(users_ssh_dir, name+'.pub')
      certificate_path = os.path.join(users_ssh_dir, name+'-cert.pub')
      try:
          if os.path.exists(private_key_path):
              os.remove(private_key_path)
          if os.path.exists(public_key_path):
              os.remove(public_key_path)
          if os.path.exists(certificate_path):
              os.remove(certificate_path)
      except Exception as e:
          out_dict['result'] = _("Error deleting keypair: %s" % e)
      message = {
          'terminal:sshjs_delete_identity_complete': out_dict
      }
      self.write_message(message)
function_tokens: def delete_identity ( self , name ) : self . ssh_log . info ( 'Deleting SSH identity: %s' % name , metadata = { 'name' : name } ) out_dict = { 'result' : 'Success' } users_ssh_dir = get_ssh_dir ( self ) private_key_path = os . path . join ( users_ssh_dir , name ) public_key_path = os . path . join ( users_ssh_dir , name + '.pub' ) certificate_path = os . path . join ( users_ssh_dir , name + '-cert.pub' ) try : if os . path . exists ( private_key_path ) : os . remove ( private_key_path ) if os . path . exists ( public_key_path ) : os . remove ( public_key_path ) if os . path . exists ( certificate_path ) : os . remove ( certificate_path ) except Exception as e : out_dict [ 'result' ] = _ ( "Error deleting keypair: %s" % e ) message = { 'terminal:sshjs_delete_identity_complete' : out_dict } self . write_message ( message )