reset a virtual machine
        :param str userid: the id of the virtual machine to be reset
        :returns: None
425194
def guest_reset(self, userid):
        
        action = "reset guest '%s'" % userid
        with zvmutils.log_and_reraise_sdkbase_error(action):
            self._vmops.guest_reset(userid)
891447
def vswitch_set_vlan_id_for_user(self, vswitch_name, userid, vlan_id):
        
        self._networkops.set_vswitch_port_vlan_id(vswitch_name,
                                                  userid, vlan_id)
163544
def set_euid():
    
    current = os.geteuid()
    logger.debug("Current EUID is %s" % current)

    if settings.DROPLET_USER is None:
        logger.info("Not changing EUID, DROPLET_USER is None")
        return

    uid = int(pwd.getpwnam(settings.DROPLET_USER).pw_uid)
    if current != uid:
        try:
            os.seteuid(uid)
            logger.info("Set EUID to %s (%s)" %
                        (settings.DROPLET_USER, os.geteuid()))
        except:
            current_user = pwd.getpwuid(os.getuid()).pw_name
            logger.error("Failed to set '%s' EUID, running as '%s'" %
                         (settings.DROPLET_USER, current_user))
    else:
        logger.debug("Didn't set EUID, it was already correct")
1078247
public void clearCredential(String userId) throws AuthException {
        try {
            authorizationCodeFlow.getCredentialDataStore().delete(userId);
        } catch (IOException e) {
            throw new AuthException("Unable to clear credential.", e);
        }
    }
40386
def reset(self):
        
        # Session IDs can be random on every connection
        self.id = struct.unpack('q', os.urandom(8))[0]
        self._sequence = 0
        self._last_msg_id = 0
634302
def reset(project, user):
        """"""
        d = Project.path(project, user) + "output"
        if os.path.isdir(d):
            shutil.rmtree(d)
            os.makedirs(d)
        else:
            raise flask.abort(404)
        if os.path.exists(Project.path(project, user) + ".done"):
            os.unlink(Project.path(project, user) + ".done")
        if os.path.exists(Project.path(project, user) + ".status"):
            os.unlink(Project.path(project, user) + ".status")
300544
def reset(self):
        

        # Delete user config file
        try:
            os.remove(self._user_config_file)
        except FileNotFoundError:
            pass

        # Empty and refill the config object
        for section_name in self.sections():
            self.remove_section(section_name)
        self.read_defaults()
101702
def regenerate_recovery_code(self, user_id):
        
        url = self._url('{}/recovery-code-regeneration'.format(user_id))
        return self.client.post(url)
1298593
def reset
			self.access_token           = DEFAULT_ACCESS_TOKEN
			self.authorization_endpoint = DEFAULT_AUTHORIZATION_ENDPOINT
			self.client_id              = DEFAULT_CLIENT_ID
			self.client_secret          = DEFAULT_CLIENT_SECRET
			self.endpoint               = DEFAULT_ENDPOINT
			self.proxy                  = DEFAULT_PROXY
			self.user_agent             = DEFAULT_USER_AGENT
		end
651916
def reset(name):
    '''
    
    '''
    ret = {}
    client = salt.client.get_local_client(__opts__['conf_file'])
    data = vm_info(name, quiet=True)
    if not data:
        __jid_event__.fire_event({'message': 'Failed to find VM {0} to reset'.format(name)}, 'progress')
        return 'fail'
    host = next(six.iterkeys(data))
    try:
        cmd_ret = client.cmd_iter(
                host,
                'virt.reset',
                [name],
                timeout=600)
        for comp in cmd_ret:
            ret.update(comp)
        __jid_event__.fire_event({'message': 'Reset VM {0}'.format(name)}, 'progress')
    except SaltClientError as client_error:
        print(client_error)
    return ret
151178
def reset(self):
        

        self._is_impersonating = False
        self._impersonation = None

        self.user = None
        self.password = None
        self.api_key = None
        self.enterprise = None
        self.url = None
130798
def set_uid(self):
        """"""
        if self.user:
            uid = getpwnam(self.user).pw_uid
            try:
                os.setuid(uid)
            except Exception:
                message = ('Unable to switch ownership to {0}:{1}. ' +
                           'Did you start the daemon as root?')
                print(message.format(self.user, self.group))
                sys.exit(1)
920374
def unblock(self, other_user_id):
        
        params = {'user': self.user_id, 'otherUser': other_user_id}
        response = self.session.delete(self.url, params=params)
        return response.ok
1002795
def _uncouple_nic(self, userid, vdev, active=False):
        """"""
        if active:
            self._is_active(userid)
        msg = ('Start to uncouple nic device %(vdev)s of guest %(vm)s'
                % {'vdev': vdev, 'vm': userid})
        LOG.info(msg)

        requestData = ' '.join((
            'SMAPI %s' % userid,
            "API Virtual_Network_Adapter_Disconnect_DM",
            "--operands",
            "-v %s" % vdev))

        try:
            self._request(requestData)
        except (exception.SDKSMTRequestFailed,
                exception.SDKInternalError) as err:
            results = err.results
            emsg = err.format_message()
            if ((results is not None) and
                (results['rc'] == 212) and
                (results['rs'] == 32)):
                LOG.warning("Virtual device %s is already disconnected "
                            "in the guest's user direct", vdev)
            else:
                LOG.error("Failed to uncouple nic %s in the guest's user "
                          "direct, error: %s" % (vdev, emsg))
                self._uncouple_inactive_exception(err, userid, vdev)

        """Update information in switch table."""
        self._NetDbOperator.switch_update_record_with_switch(userid, vdev,
                                                             None)

        # the inst must be active, or this call will failed
        if active:
            requestData = ' '.join((
                'SMAPI %s' % userid,
                'API Virtual_Network_Adapter_Disconnect',
                "--operands",
                "-v %s" % vdev))
            try:
                self._request(requestData)
            except (exception.SDKSMTRequestFailed,
                    exception.SDKInternalError) as err:
                results = err.results
                emsg = err.format_message()
                if ((results is not None) and
                    (results['rc'] == 204) and
                    (results['rs'] == 48)):
                    LOG.warning("Virtual device %s is already "
                                "disconnected on the active "
                                "guest system", vdev)
                else:
                    LOG.error("Failed to uncouple nic %s on the active "
                              "guest system, error: %s" % (vdev, emsg))
                    self._uncouple_active_exception(err, userid, vdev)
        msg = ('Uncouple nic device %(vdev)s of guest %(vm)s successfully'
                % {'vdev': vdev, 'vm': userid})
        LOG.info(msg)
761930
def destroy_vm_by_uuid(self, si, vm_uuid, vm_path, logger):
        
        if vm_uuid is not None:
            vm = self.find_by_uuid(si, vm_uuid, vm_path)
            if vm:
                return self.destroy_vm(vm, logger)
        # return 'vm not found'
        # for apply the same Interface as for 'destroy_vm_by_name'
        raise ValueError('vm not found')
1014967
def cli(env, identifier):
    

    mgr = SoftLayer.UserManager(env.client)

    user_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'username')

    user_template = {'userStatusId': 1021}

    result = mgr.edit_user(user_id, user_template)
    if result:
        click.secho("%s deleted successfully" % identifier, fg='green')
    else:
        click.secho("Failed to delete %s" % identifier, fg='red')
858274
def reset_all():
  
  global _username
  global _password
  global _active_config
  global _active_tests
  global _machine_names
  global _deployers
  reset_deployers()
  reset_collector()
  _username = None
  _password = None
  _active_config = None
  _active_tests = {}
  _machine_names = defaultdict()