()
| 117 | |
| 118 | |
| 119 | def get_aws_cmd(): |
| 120 | global AWS_CMD |
| 121 | import awscli |
| 122 | |
| 123 | if AWS_CMD is None: |
| 124 | # Try <repo>/bin/aws |
| 125 | repo_root = os.path.dirname(os.path.abspath(awscli.__file__)) |
| 126 | aws_cmd = os.path.join(repo_root, 'bin', 'aws') |
| 127 | if not os.path.isfile(aws_cmd): |
| 128 | aws_cmd = _search_path_for_cmd('aws') |
| 129 | if aws_cmd is None: |
| 130 | raise ValueError( |
| 131 | 'Could not find "aws" executable. Either ' |
| 132 | 'make sure it is on your PATH, or you can ' |
| 133 | 'explicitly set this value using ' |
| 134 | '"set_aws_cmd()"' |
| 135 | ) |
| 136 | AWS_CMD = aws_cmd |
| 137 | return AWS_CMD |
| 138 | |
| 139 | |
| 140 | def _search_path_for_cmd(cmd_name): |
no test coverage detected