Do not require authentication for the validator CLI

Since most of the actions of the validator is based on the filesystem,
we really don't need to require auth.
The only subcommand that might require it is the "run", since it might
go through the inventory generation.

Also, pass the "--os-cloud" parameter down to the
tripleo-ansible-inventory script. Value is hardcoded, since it is an
entry name we can't set (yet). It allows to authenticate only for the
relevant part of the validation run.

Resolves: rhbz#1892323
Closes-Bug: #1902052

Change-Id: I32c1e006d10ceb541aadb486befd8aa8fc6aa045
(cherry picked from commit aafd981948)
This commit is contained in:
Cédric Jeanneret 2020-10-29 13:13:11 +01:00 committed by Cédric Jeanneret (Tengu)
parent 28f55e7176
commit f9a16b143c
2 changed files with 16 additions and 2 deletions

View File

@ -1606,8 +1606,8 @@ def get_tripleo_ansible_inventory(inventory_file=None,
'--stack', stack,
'--ansible_ssh_user', ssh_user,
'--undercloud-connection', undercloud_connection,
'--undercloud-key-file',
get_key(stack=stack),
'--undercloud-key-file', get_key(stack=stack),
'--os-cloud', 'undercloud',
'--static-yaml-inventory', inventory_file)
except processutils.ProcessExecutionError as e:
message = _("Failed to generate inventory: %s") % str(e)

View File

@ -64,6 +64,8 @@ class _CommaListAction(argparse.Action):
class TripleOValidatorGroupInfo(command.Lister):
"""Display Information about Validation Groups"""
auth_required = False
def get_parser(self, prog_name):
parser = super(TripleOValidatorGroupInfo, self).get_parser(prog_name)
return parser
@ -76,6 +78,8 @@ class TripleOValidatorGroupInfo(command.Lister):
class TripleOValidatorShow(command.ShowOne):
"""Display detailed information about a Validation"""
auth_required = False
def get_parser(self, prog_name):
parser = super(TripleOValidatorShow, self).get_parser(prog_name)
@ -100,6 +104,8 @@ class TripleOValidatorShow(command.ShowOne):
class TripleOValidatorShowParameter(command.Command):
"""Display Validations Parameters"""
auth_required = False
def get_parser(self, prog_name):
parser = argparse.ArgumentParser(
description=self.get_description(),
@ -174,6 +180,8 @@ class TripleOValidatorShowParameter(command.Command):
class TripleOValidatorList(command.Lister):
"""List the available validations"""
auth_required = False
def get_parser(self, prog_name):
parser = super(TripleOValidatorList, self).get_parser(prog_name)
@ -207,6 +215,8 @@ class TripleOValidatorList(command.Lister):
class TripleOValidatorRun(command.Command):
"""Run the available validations"""
auth_required = False
def get_parser(self, prog_name):
parser = argparse.ArgumentParser(
description=self.get_description(),
@ -381,6 +391,8 @@ class TripleOValidatorRun(command.Command):
class TripleOValidatorShowRun(command.Command):
"""Display details about a Validation execution"""
auth_required = False
def get_parser(self, prog_name):
parser = argparse.ArgumentParser(
description=self.get_description(),
@ -421,6 +433,8 @@ class TripleOValidatorShowRun(command.Command):
class TripleOValidatorShowHistory(command.Lister):
"""Display Validations execution history"""
auth_required = False
def get_parser(self, prog_name):
parser = super(TripleOValidatorShowHistory, self).get_parser(prog_name)