DescriptionDavid Vallee Delisle
2018-05-19 20:39:20 UTC
+++ This bug was initially created as a clone of Bug #1570315 +++
Description of problem:
When we run environment-get to a file, modify the file and reimport it with environment-update without deleting the 2 date fields, the error message is not very explicit.
Version-Release number of selected component (if applicable):
python-openstack-mistral-3.0.2-12.el7ost.noarch
openstack-mistral-executor-3.0.2-12.el7ost.noarch
puppet-mistral-9.5.0-2.el7ost.noarch
openstack-mistral-engine-3.0.2-12.el7ost.noarch
python-mistralclient-2.1.2-1.el7ost.noarch
openstack-mistral-common-3.0.2-12.el7ost.noarch
openstack-mistral-api-3.0.2-12.el7ost.noarch
How reproducible:
All the time
Steps to Reproduce:
1. $ mistral environment-get -f yaml overcloud > overcloud.yaml
2. $ mistral environment-update -f yaml overcloud.yaml
Actual results:
ERROR (app) None
Expected results:
Exception in mistral/api/controllers/v2/environment.py should be raised or returned
171 def _validate_environment(env_dict, legal_keys):
172 if env_dict is None:
173 return
174
175 if set(env_dict) - set(legal_keys):
176 raise exceptions.InputException(
177 "Please, check your environment definition. Only: "
178 "%s are allowed as definition keys." % legal_keys
179 )
Additional info:
[stack@pbnec1-l-rh-ucld-0 ~]$ mistral --debug environment-update -f yaml overcloud.yaml
DEBUG (v2) Making authentication request to https://192.168.4.2:13000/v2.0/tokens
DEBUG (extension) found extension EntryPoint.parse('table = cliff.formatters.table:TableFormatter')
DEBUG (extension) found extension EntryPoint.parse('json = cliff.formatters.json_format:JSONFormatter')
DEBUG (extension) found extension EntryPoint.parse('shell = cliff.formatters.shell:ShellFormatter')
DEBUG (extension) found extension EntryPoint.parse('value = cliff.formatters.value:ValueFormatter')
DEBUG (extension) found extension EntryPoint.parse('yaml = cliff.formatters.yaml_format:YAMLFormatter')
DEBUG (command) run(Namespace(columns=[], file=<open file 'overcloud.yaml', mode 'r' at 0x25d4c00>, formatter='yaml', max_width=0, noindent=False, prefix='', variables=[]))
ERROR (app) None
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cliff/app.py", line 387, in run_subcommand
result = cmd.run(parsed_args)
File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
return super(Command, self).run(parsed_args)
File "/usr/lib/python2.7/site-packages/cliff/display.py", line 100, in run
column_names, data = self.take_action(parsed_args)
File "/usr/lib/python2.7/site-packages/mistralclient/commands/v2/environments.py", line 184, in take_action
environment = mistral_client.environments.update(**data)
File "/usr/lib/python2.7/site-packages/mistralclient/api/v2/environments.py", line 66, in update
self._ensure_not_empty(name=name)
File "/usr/lib/python2.7/site-packages/mistralclient/api/base.py", line 78, in _ensure_not_empty
(self.resource_class.__name__, name))
APIException: None
Traceback (most recent call last):
File "/usr/bin/mistral", line 10, in <module>
sys.exit(main())
File "/usr/lib/python2.7/site-packages/mistralclient/shell.py", line 602, in main
return MistralShell().run(argv)
File "/usr/lib/python2.7/site-packages/cliff/app.py", line 267, in run
result = self.run_subcommand(remainder)
File "/usr/lib/python2.7/site-packages/cliff/app.py", line 387, in run_subcommand
result = cmd.run(parsed_args)
File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
return super(Command, self).run(parsed_args)
File "/usr/lib/python2.7/site-packages/cliff/display.py", line 100, in run
column_names, data = self.take_action(parsed_args)
File "/usr/lib/python2.7/site-packages/mistralclient/commands/v2/environments.py", line 184, in take_action
environment = mistral_client.environments.update(**data)
File "/usr/lib/python2.7/site-packages/mistralclient/api/v2/environments.py", line 66, in update
self._ensure_not_empty(name=name)
File "/usr/lib/python2.7/site-packages/mistralclient/api/base.py", line 78, in _ensure_not_empty
(self.resource_class.__name__, name))
mistralclient.api.base.APIException: None