Raise NoSuchKeystoneCredentials when credentials files are not found
The exception raised when the credentials files were not found was InvalidRCFile instead of NoSuchKeystoneCredentials All shiftstack tests failed due to this on environments where shiftstack was not deployed - with this patch, they are skipped instead Change-Id: I4fc2c40ce03f36705eec6336bc2f9639bb49b79f
This commit is contained in:
parent
212c9958d5
commit
39313ebe2c
@ -63,7 +63,7 @@ def fetch_os_env(rcfile: str, *rcfiles: str) -> typing.Dict[str, str]:
|
|||||||
except sh.ShellCommandFailed as ex:
|
except sh.ShellCommandFailed as ex:
|
||||||
LOG.debug(f"Unable to get overcloud RC file '{rcfile}' content "
|
LOG.debug(f"Unable to get overcloud RC file '{rcfile}' content "
|
||||||
f"({ex})")
|
f"({ex})")
|
||||||
errors.append(tobiko.exc_info)
|
errors.append(ex)
|
||||||
else:
|
else:
|
||||||
LOG.debug(f'Parsing environment variables from: {rcfile}...')
|
LOG.debug(f'Parsing environment variables from: {rcfile}...')
|
||||||
env = {}
|
env = {}
|
||||||
@ -75,9 +75,10 @@ def fetch_os_env(rcfile: str, *rcfiles: str) -> typing.Dict[str, str]:
|
|||||||
LOG.debug(f'Environment variables read from: {rcfile}:\n'
|
LOG.debug(f'Environment variables read from: {rcfile}:\n'
|
||||||
f'{env_dump}')
|
f'{env_dump}')
|
||||||
return env
|
return env
|
||||||
for error in errors:
|
if errors and all("No such file or directory" in error.stderr
|
||||||
LOG.exception(f"Unable to get overcloud RC file '{rcfile}' "
|
for error in errors):
|
||||||
"content", exc_info=error)
|
LOG.warning('None of the credentials files were found')
|
||||||
|
raise keystone.NoSuchKeystoneCredentials()
|
||||||
raise InvalidRCFile(rcfile=", ".join(rcfiles))
|
raise InvalidRCFile(rcfile=", ".join(rcfiles))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user