本文整理汇总了Python中botocore.exceptions.RefreshWithMFAUnsupportedError方法的典型用法代码示例。如果您正苦于以下问题:Python exceptions.RefreshWithMFAUnsupportedError方法的具体用法?Python exceptions.RefreshWithMFAUnsupportedError怎么用?Python exceptions.RefreshWithMFAUnsupportedError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类botocore.exceptions
的用法示例。
在下文中一共展示了exceptions.RefreshWithMFAUnsupportedError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_mfa_serial_refresher
# 需要导入模块: from botocore import exceptions [as 别名]
# 或者: from botocore.exceptions import RefreshWithMFAUnsupportedError [as 别名]
def create_mfa_serial_refresher(actual_refresh):
class _Refresher(object):
def __init__(self, refresh):
self._refresh = refresh
self._has_been_called = False
def __call__(self):
if self._has_been_called:
# We can explore an option in the future to support
# reprompting for MFA, but for now we just error out
# when the temp creds expire.
raise RefreshWithMFAUnsupportedError()
self._has_been_called = True
return self._refresh()
return _Refresher(actual_refresh)
示例2: create_mfa_serial_refresher
# 需要导入模块: from botocore import exceptions [as 别名]
# 或者: from botocore.exceptions import RefreshWithMFAUnsupportedError [as 别名]
def create_mfa_serial_refresher():
def _refresher():
# We can explore an option in the future to support
# reprompting for MFA, but for now we just error out
# when the temp creds expire.
raise RefreshWithMFAUnsupportedError()
return _refresher