This AWS page建议进行以下调用:
$ aws iam update-role -–role-name ADFS-Production -–max-session-duration 14400
当我运行它(替换正确的角色名称)时,我得到了
aws: error: the following arguments are required: --role-name
这很令人困惑,因为这个论点就在那里!
$ aws --version
我的机器上的给出了
aws-cli/1.14.69 Python/3.6.4 Darwin/16.3.0 botocore/1.9.22
我尝试使用调试器逐步执行arg解析,看起来似乎问题是option_string_actions列表没有正确填充:
/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/argparse.py(2093)_parse_optional()
-> if arg_string in self._option_string_actions:
(Pdb) l
2088 # if it doesn't start with a prefix, it was meant to be positional
2089 if not arg_string[0] in self.prefix_chars:
2090 return None
2091
2092 # if the option string is present in the parser, return the action
2093 -> if arg_string in self._option_string_actions:
2094 action = self._option_string_actions[arg_string]
2095 return action, arg_string, None
2096
2097 # if it's just a single character, it was meant to be positional
2098 if len(arg_string) == 1:
(Pdb) self._option_string_actions
{}
但它很复杂,所以很难确定。有什么想法吗?
答案 0 :(得分:3)
我运行了你的命令,而你的--
出现了问题。您可以尝试以下命令(除了您的--
:
aws iam update-role --role-name ADFS-Production --max-session-duration 14400