Merge pull request #4732 from ryanpetrello/cli-migrating

cli: show a better error if AWX is migrating

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-09-13 13:50:14 +00:00 committed by GitHub
commit ed692018cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,14 @@ class CLI(object):
raise
def fetch_version_root(self):
self.v2 = self.root.get().available_versions.v2.get()
try:
self.v2 = self.root.get().available_versions.v2.get()
except AttributeError:
raise RuntimeError(
'An error occurred while fetching {}/api/'.format(
self.get_config('host')
)
)
def parse_resource(self, skip_deprecated=False):
"""Attempt to parse the <resource> (e.g., jobs) specified on the CLI