本文整理汇总了Python中user_app_client.UserAppClient.change_password方法的典型用法代码示例。如果您正苦于以下问题:Python UserAppClient.change_password方法的具体用法?Python UserAppClient.change_password怎么用?Python UserAppClient.change_password使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user_app_client.UserAppClient
的用法示例。
在下文中一共展示了UserAppClient.change_password方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reset_password
# 需要导入模块: from user_app_client import UserAppClient [as 别名]
# 或者: from user_app_client.UserAppClient import change_password [as 别名]
def reset_password(cls, options):
"""Resets a user's password the currently running AppScale deployment.
Args:
options: A Namespace that has fields for each parameter that can be
passed in via the command-line interface.
"""
secret = LocalState.get_secret_key(options.keyname)
username, password = LocalState.get_credentials(is_admin=False)
encrypted_password = LocalState.encrypt_password(username, password)
uac = UserAppClient(LocalState.get_login_host(options.keyname), secret)
try:
uac.change_password(username, encrypted_password)
AppScaleLogger.success("The password was successfully changed for the " "given user.")
except Exception as exception:
AppScaleLogger.warn(
"Could not change the user's password for the " + "following reason: {0}".format(str(exception))
)
sys.exit(1)