Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set task duration to zero if None (fixes #598) fixes #598 with @cidrblock 's recommendation Worked with @alisonlhart was able to reproduce the issue and tested with steps listed in the issue. before Traceback (most recent call last): File "/home/aubin/work/env/py38.0/bin/ansible-navigator", line 8, in <module> sys.exit(main()) File "/home/aubin/work/env/py38.0/lib/python3.8/site-packages/ansible_navigator/cli.py", line 141, in main return_code = run(args) File "/home/aubin/work/env/py38.0/lib/python3.8/site-packages/ansible_navigator/cli.py", line 79, in run return_code = run_action_stdout(args.app.replace("-", "_"), args) File "/home/aubin/work/env/py38.0/lib/python3.8/site-packages/ansible_navigator/actions/_actions.py", line 109, in run_stdout return action_cls(args).run_stdout() File "/home/aubin/work/env/py38.0/lib/python3.8/site-packages/ansible_navigator/actions/run.py", line 249, in run_stdout self._dequeue() File "/home/aubin/work/env/py38.0/lib/python3.8/site-packages/ansible_navigator/actions/run.py", line 612, in _dequeue self._handle_message(message) File "/home/aubin/work/env/py38.0/lib/python3.8/site-packages/ansible_navigator/actions/run.py", line 664, in _handle_message task["__duration"] = human_time(seconds=round(task["duration"], 2)) TypeError: type NoneType doesn't define __round__ method after ansible-navigator run ./test_inventory.yml -m stdout -v -i ./inventory.ini No config file found; using defaults PLAY [all] ********************************************************************* TASK [End play if remote host] ************************************************* skipping: [localhost] => {"msg": "end_host conditional evaluated to false, continuing execution for localhost", "skip_reason": "end_host conditional evaluated to False, continuing execution for localhost"} PLAY RECAP ********************************************************************* ansible-navigator log entry 211123164144.219 DEBUG 'ansible_navigator.actions.run_playbook._handle_message' Task duration for 'End play if remote host' was type <class 'NoneType'>, set to 0 Reviewed-by: Sorin Sbarnea <sorin.sbarnea@gmail.com> Reviewed-by: Bradley A. Thornton <bthornto@redhat.com> Reviewed-by: None <None>
- Loading branch information