cli: show a better error if AWX is migrating

see: https://github.com/ansible/awx/issues/4721
This commit is contained in:
Ryan Petrello 2019-09-12 17:14:25 -04:00
parent 70057bc0f2
commit 9d93cf8021
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

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