Update patch set 21

Patch Set 21: Code-Review-1

(1 comment)

Just tried to use a relative path for the validation-log-dir and I've got this issue:

   [stack@undercloud ~]$ validation -v --debug run --validation 512e --validation-log-dir mylogs_dir 
   Initialize Validation App.
   prepare_to_run_command Run
   Selected log directory 'mylogs_dir' does not exist. Attempting to create it.
   Running the validations with Ansible
   Ansible playbook /usr/share/ansible/validation-playbooks/512e.yaml found
   Running Ansible playbook: /usr/share/ansible/validation-playbooks/512e.yaml, Working directory:    mylogs_dir/artifacts/157464b5-016a-42f1-97a2-5560cd1e9e21_512e.yaml_2021-06-10T09:51:42.115528Z,    Playbook directory: /usr/share/ansible/validation-playbooks  
   No validation has been run, please check log in the Ansible working directory.
   Traceback (most recent call last):
     File "/usr/lib/python3.6/site-packages/cliff/app.py", line 401, in run_subcommand
       result = cmd.run(parsed_args)
     File "/usr/lib/python3.6/site-packages/cliff/command.py", line 185, in run
       return_code = self.take_action(parsed_args) or 0
     File "/usr/local/lib/python3.6/site-packages/validations_libs/cli/run.py", line 198, in take_action
       raise RuntimeError(msg)
   RuntimeError: No validation has been run, please check log in the Ansible working directory.
   clean_up Run
   got an error: No validation has been run, please check log in the Ansible working directory.


The mylogs_dir has been created where I run the validation command but it fails when trying to write the logs... ;)

And some minor improvements/adjustments should be addressed in the help rendering output!

Patch-set: 21
Reviewer: Gerrit User 11491 <11491@4a232e18-c5a9-48ee-94c0-e04e7cca6543>
Label: Code-Review=-1
This commit is contained in:
Gerrit User 11491 2021-06-10 09:57:52 +00:00 committed by Gerrit Code Review
parent 8dfe8efa27
commit c7ab3e2724
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
{
"comments": [
{
"key": {
"uuid": "302dd476_6a0d22b9",
"filename": "validations_libs/cli/run.py",
"patchSetId": 21
},
"lineNbr": 98,
"author": {
"id": 11491
},
"writtenOn": "2021-06-10T09:57:52Z",
"side": 1,
"message": "Could you please group the --validation-log-dir argument with --validation-dir/--ansible-base-dir? \n\nAnd remove the metavar to be compliant with the other ones?\n\nI\u0027ve got this otherwise:\n\n optional arguments:\n -h, --help show this help message and exit\n --limit LIMIT A string that identifies a single node or comma-\n separated list of nodes to be upgraded in parallel in\n this upgrade run invocation. For example: --limit\n \"compute-0,compute-1,compute-5\".\n --ssh-user SSH_USER SSH user name for the Ansible ssh connection.\n --validation-dir VALIDATION_DIR\n Path where the validation playbooks is located.\n --ansible-base-dir ANSIBLE_BASE_DIR\n Path where the ansible roles, library and plugins are\n located.\n --inventory INVENTORY, -i INVENTORY\n Path of the Ansible inventory.\n --output-log OUTPUT_LOG\n Path where the run result will be stored.\n --junitxml JUNITXML Path where the run result in JUnitXML format will be\n stored.\n --python-interpreter --python-interpreter \u003cPYTHON_INTERPRETER_PATH\u003e\n Python interpreter for Ansible execution.\n --extra-env-vars key1\u003d\u003cval1\u003e [--extra-vars key3\u003d\u003cval3\u003e]\n Add extra environment variables you may need to\n provide to your Ansible execution as KEY\u003dVALUE pairs.\n Note that if you pass the same KEY multiple times, the\n last given VALUE for that same KEY will override the\n other(s)\n --validation-log-dir \u003cLOG-DIR\u003e\n Path where the log files and artifacts will be\n located.\n --extra-vars key1\u003d\u003cval1\u003e [--extra-vars key3\u003d\u003cval3\u003e]\n Add Ansible extra variables to the validation(s)\n execution as KEY\u003dVALUE pair(s). Note that if you pass\n the same KEY multiple times, the last given VALUE for\n that same KEY will override the other(s)",
"revId": "a24fb5dc2ecb086c5ed3642f1d6ea24763e1cc1d",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543",
"unresolved": true
}
]
}