ec2.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:edx-configuration 作者: kola-er 项目源码 文件源码
def parse_cli_args(self):
        ''' Command line argument processing '''

        parser = argparse.ArgumentParser(description='Produce an Ansible Inventory file based on EC2')
        parser.add_argument('--tags-only', action='store_true', default=False,
                           help='only return tags (default: False)')
        parser.add_argument('--list', action='store_true', default=True,
                           help='List instances (default: True)')
        parser.add_argument('--host', action='store',
                           help='Get all the variables about a specific instance')
        parser.add_argument('--refresh-cache', action='store_true', default=False,
                           help='Force refresh of cache by making API requests to EC2 (default: False - use cache files)')

        default_inifile = os.environ.get("ANSIBLE_EC2_INI", os.path.dirname(os.path.realpath(__file__))+'/ec2.ini')

        parser.add_argument('--inifile', dest='inifile', help='Path to init script to use', default=default_inifile)
        parser.add_argument(
            '--cache-path',
            help='Override the cache path set in ini file',
            required=False)
        self.args = parser.parse_args()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号