【发布时间】:2018-04-19 22:23:47
【问题描述】:
我们有一个安装了 aws cli 的 Jenkins 实例以及一个固定的 boto 版本。这导致实例中的 aws 无法解析
# aws
Traceback (most recent call last):
File "/bin/aws", line 27, in <module>
sys.exit(main())
File "/bin/aws", line 23, in main
return awscli.clidriver.main()
File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 58, in main
driver = create_clidriver()
File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 69, in create_clidriver
event_hooks=emitter)
File "/usr/lib/python2.7/site-packages/awscli/plugin.py", line 44, in load_plugins
modules = _import_plugins(plugin_mapping)
File "/usr/lib/python2.7/site-packages/awscli/plugin.py", line 61, in _import_plugins
module = __import__(path, fromlist=[module])
File "/usr/lib/python2.7/site-packages/awscli/handlers.py", line 24, in <module>
from awscli.customizations.assumerole import register_assume_role_provider
File "/usr/lib/python2.7/site-packages/awscli/customizations/assumerole.py", line 5, in <module>
from botocore.credentials import JSONFileCache
使用完整路径运行 aws 有效
# /usr/local/aws/bin/aws
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: too few arguments
更新环境变量中的路径并不能解决问题。
任何想法
【问题讨论】:
-
为了提供一些上下文,我们让 chef 在这个实例上运行,并使用调用 aws cli 的说明书。由于这些食谱不需要定义 aws cli 路径,因为通常 aws 会默认解析为 cli,因此 Chef 现在在此特定实例上失败
标签: amazon-web-services chef-infra boto botocore