Update credentials of a redfish system

        :param password: password to be updated
325728
def update_credentials(self, password):
        
        data = {
            'Password': password,
        }
        self._conn.patch(self.path, data=data)
863223
def update_user(self, user, name=None, password=None, host=None):
        
        return self._user_manager.update(user, name=name, password=password,
                host=host)
900101
def update_user_password(client, userpass):
    """"""
    vault_path = ''
    user = ''
    user_path_bits = userpass.split('/')
    if len(user_path_bits) == 1:
        user = user_path_bits[0]
        vault_path = "auth/userpass/users/%s/password" % user
        LOG.debug("Updating password for user %s at the default path", user)
    elif len(user_path_bits) == 2:
        mount = user_path_bits[0]
        user = user_path_bits[1]
        vault_path = "auth/%s/users/%s/password" % (mount, user)
        LOG.debug("Updating password for user %s at path %s", user, mount)
    else:
        client.revoke_self_token()
        raise aomi.exceptions.AomiCommand("invalid user path")

    new_password = get_password()
    obj = {
        'user': user,
        'password': new_password
    }
    client.write(vault_path, **obj)
91295
def update_password(self, user, password, skip_validation=False):
        
        pwcol = self.options["password_column"]
        pwhash = self.bcrypt.generate_password_hash(password)
        if not skip_validation:
            self.validate_password(user, password, pwhash)
        if self.options['prevent_password_reuse']:
            user.previous_passwords = [getattr(user, pwcol)] + (user.previous_passwords or [])
            if self.options['max_password_reuse_saved']:
                user.previous_passwords = user.previous_passwords[:self.options['max_password_reuse_saved']]
        setattr(user, pwcol, pwhash)
        user.last_password_change_at = datetime.datetime.utcnow()
        user.must_reset_password_at_login = False
977386
def change_password(self, new_password):
        
        self.set_password(new_password)
        self.save()
        password_changed.send(sender=self.__class__, user=self)
549731
def check_password(self, raw_password):
        
        def setter(raw_password):
            self.set_password(raw_password)
            self.save(update_fields=[self.PASSWORD_FIELD])
        return check_password(raw_password, getattr(self, self.PASSWORD_FIELD), setter)
743435
def cli(env, access_id, password):
    

    block_manager = SoftLayer.BlockStorageManager(env.client)

    result = block_manager.set_credential_password(access_id=access_id, password=password)

    if result:
        click.echo('Password updated for %s' % access_id)
    else:
        click.echo('FAILED updating password for %s' % access_id)
900417
def password(client, path):
    """"""
    if path.startswith('user:'):
        update_user_password(client, path[5:])
    else:
        update_generic_password(client, path)
219481
def update_pass(user_id, newpass):
        '''
        
        '''

        out_dic = {'success': False, 'code': '00'}

        entry = TabMember.update(user_pass=tools.md5(newpass)).where(TabMember.uid == user_id)
        entry.execute()

        out_dic['success'] = True

        return out_dic
1105246
def change_password(self, password):
        

        def cb():
            if not utils.is_password_valid(password):
                raise exceptions.AuthError("Invalid Password")
            self.user.change_password(password)
            return True

        return signals.user_update(self, ACTIONS["PASSWORD"], cb)
1224291
def _update_config_file(username, password, email, url, config_path):
        """"""
        try:
            # read the existing config
            config = json.load(open(config_path, "r"))
        except ValueError:
            config = dict()

        if not config.get('auths'):
            config['auths'] = dict()

        if not config['auths'].get(url):
            config['auths'][url] = dict()
        encoded_credentials = dict(
            auth=base64.b64encode(username + b':' + password),
            email=email
        )
        config['auths'][url] = encoded_credentials
        try:
            json.dump(config, open(config_path, "w"), indent=5, sort_keys=True)
        except Exception as exc:
            raise exceptions.AnsibleContainerConductorException(
                u"Failed to write registry config to {0} - {1}".format(config_path, exc)
            )
12679
def set_password(self, password = None):
        
        
        if password is None or type(password) is not str:
            raise KPError("Need a new image number")
        else:
            self.password = password
            self.last_mod = datetime.now().replace(microsecond=0)
            return True
520514
def set_credential_password(self, access_id, password):
        

        return self.client.call('Network_Storage_Allowed_Host', 'setCredentialPassword',
                                password, id=access_id)
589178
def update_token(self):
        """"""
        logger.info('updating token')
        if None in self.credentials.values():
            raise RuntimeError("You must provide an username and a password")
        credentials = dict(auth=self.credentials)
        url = self.test_url if self.test else self.url
        response = requests.post(url + "auth",
                                 json=credentials)
        data = response.json()["response"]
        if "error_id" in data and data["error_id"] == "NOAUTH":
            raise BadCredentials()
        if "error_code" in data and data["error_code"] == "RATE_EXCEEDED":
            time.sleep(150)
            return
        if "error_code" in data or "error_id" in data:
            raise AppNexusException(response)
        self.token = data["token"]
        self.save_token()
        return self.token
304440
def change_password(self, user, new_password):
        
        from boiler.user.models import UpdateSchema
        from flask_login import logout_user

        schema = UpdateSchema()
        user.password = new_password
        user.password_link=None
        user.password_link_expires=None
        valid = schema.validate(user)

        if not valid:
            return valid

        db.session.add(user)
        db.session.commit()

        # logout if a web request
        if has_request_context():
            logout_user()

        events.password_changed_event.send(user)
        return user
1033310
def change_password(self, previous, new_password):
        
        if not self.verify_password(previous):
            raise exceptions.Unauthorized('Incorrect password')

        if len(new_password) < options.min_length_password:
            msg = ('Passwords must be at least {} characters'
                   .format(options.min_length_password))
            raise exceptions.ValidationError(msg)

        if len(new_password) > options.max_length_password:
            msg = ('Passwords must be at no more than {} characters'
                   .format(options.max_length_password))
            raise exceptions.ValidationError(msg)

        self.password = self.hash_password(new_password)
        yield self._save()
54685
def set_password(self, service, username, password):
        
        segments = range(0, len(password), self._max_password_size)
        password_parts = [
            password[i:i + self._max_password_size] for i in segments]
        for i, password_part in enumerate(password_parts):
            curr_username = username
            if i > 0:
                curr_username += '{{part_%d}}' % i
            self._keyring.set_password(service, curr_username, password_part)