Bug 1570315 - [OSP12] Unable to environment-update from environment-get
Summary: [OSP12] Unable to environment-update from environment-get
Keywords:
Status: CLOSED EOL
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-mistralclient
Version: 12.0 (Pike)
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: 12.0 (Pike)
Assignee: Brad P. Crochet
QA Contact: nlevinki
URL:
Whiteboard:
Depends On:
Blocks: 1575414 1580073
TreeView+ depends on / blocked
 
Reported: 2018-04-21 21:16 UTC by David Vallee Delisle
Modified: 2019-01-11 16:26 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1575414 1580073 (view as bug list)
Environment:
Last Closed: 2019-01-11 16:26:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1769491 0 None None None 2018-05-19 20:51:55 UTC
OpenStack gerrit 573419 0 None None None 2018-07-03 13:02:01 UTC

Description David Vallee Delisle 2018-04-21 21:16:32 UTC
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


Note You need to log in before you can comment on or make changes to this bug.