Open LegenJCdary opened 2 years ago
Best solution would be to make opts and file required when "module" is "script". This cannot be achieved with cerberus in straight-forward way, dedicated Validator needs to be written and imported e.g. https://stackoverflow.com/questions/56705509/dependencies-validation-using-cerberus
Traceback (most recent call last): File "/home/fazi/deploy-ans/ansible-deployer/source/modules/runners/run.py", line 41, in setup_ansible with subprocess.Popen([hook["opts"]["file"], commit], KeyError: 'opts'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/fazi/deploy-ans/ansible-deployer/source/main.py", line 174, in
main()
File "/home/fazi/deploy-ans/ansible-deployer/source/main.py", line 155, in main
runner.setup_ansible(selected_items["commit"])
File "/home/fazi/deploy-ans/ansible-deployer/source/modules/runners/run.py", line 49, in setup_ansible
self.logger.critical("Failed executing %s: %s", hook["opts"]["file"], e)
KeyError: 'opts'