template validate reports invalid error while using improper template
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-heatclient |
Confirmed
|
Medium
|
Sharat Sharma |
Bug Description
With invalid json formated template file, template validation fails as below:
leagacy heat template-validate reports circular reference error
=======
manickan@
DEBUG (session) REQ: curl -g -i -X GET http://
INFO (connectionpool) Starting new HTTP connection (1): 172.241.0.101
DEBUG (connectionpool) "GET /v3 HTTP/1.1" 200 252
DEBUG (session) RESP: [200] Content-Length: 252 Vary: X-Auth-Token Connection: keep-alive Date: Tue, 19 Apr 2016 05:48:30 GMT Content-Type: application/json X-Openstack-
RESP BODY: {"version": {"status": "stable", "updated": "2016-04-
DEBUG (base) Making authentication request to http://
DEBUG (connectionpool) "POST /v3/auth/tokens HTTP/1.1" 201 7736
WARNING (shell) "heat template-validate" is deprecated, please use "openstack orchestration template validate" instead
Traceback (most recent call last):
File "/usr/local/
sys.
File "/opt/stack/
HeatShell(
File "/opt/stack/
args.
File "/opt/stack/
validation = hc.stacks.
File "/opt/stack/
resp = self.client.
File "/usr/local/
return self.request(url, 'POST', **kwargs)
File "/opt/stack/
**kwargs)
File "/usr/local/
resp = super(LegacyJso
File "/usr/local/
return self.session.
File "/usr/local/
return func(*args, **kwargs)
File "/usr/local/
kwargs['data'] = jsonutils.
File "/usr/local/
return json.dumps(obj, default=default, **kwargs)
File "/usr/lib/
sort_
File "/usr/lib/
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/
return _iterencode(o, 0)
ValueError: Circular reference detected
manickan@
orchestration template validate command reports template version in datatime error
=======
manickan@
START with options: ['-v', 'orchestration', 'template', 'validate', '-t', 'hello-
command: orchestration template validate -> heatclient.
/usr/local/
auth_plugin_class = base.get_
Using auth plugin: password
/usr/local/
'in future releases.', DeprecationWarning)
/usr/local/
'removed in future releases.', DeprecationWarning)
datetime.date(2016, 10, 14) is not JSON serializable
END return value: 1
manickan@
template used
=============
heat_template_
description:
First heat hot template used to demonstrate the hot template sections.
resources:
first_rsc:
type: OS::Heat:
outputs:
random_str:
value: {get_attr:
To fix this case, its better to validate the given template is proper one by using template_
Changed in heat: | |
assignee: | nobody → Sharat Sharma (sharat-sharma) |
affects: | heat → python-heatclient |
Reproduced this issue on OpenStack Mitaka Release. In Mitaka, the reported command (see below):
############# 2-invalid- output- value-assigneme nt.yaml"
"openstack -v orchestration template validate -t hello-world-
#############
will be run like below command in Mitaka Release because "openstack orchestration template validate" is removed in Mitaka release and instead that functionality is added to "openstack stack create --dry-run" command shown below:
########### 2-invalid- output- value-assigneme nt.yaml --dry-run mystack"
"openstack -v stack create -t hello-world-
###########
In the above example, "mystack" is the name of the stack.
Issue Reproduction Log: ------- ------- - ------- ------- - :/home/ ubuntu# openstack -v stack create -t my-temp1.yaml --dry-run mystack osc.v1. stack.CreateSta ck python2. 7/dist- packages/ openstackclient /api/auth. py:118: DeprecationWarning: Using function/method 'keystoneclient .auth.base. get_plugin_ class() ' is deprecated in version '2.1.0' and will be removed in version '3.0.0': keystoneclient auth plugins are deprecated. Use keystoneauth. plugin_ class(auth_ plugin_ name) python2. 7/dist- packages/ keystoneclient/ auth/identity/ base.py: 56: DeprecationWarning: keystoneclient auth plugins are deprecated as of the 2.1.0 release in favor of keystoneauth1 plugins. They will be removed in future releases. python2. 7/dist- packages/ keystoneclient/ adapter. py:57: DeprecationWarning: keystoneclient. adapter. Adapter is deprecated as of the 2.1.0 release in favor of keystoneauth1. adapter. Adapter. It will be removed in future releases. :/home/ ubuntu# :/home/ ubuntu#
-------
-------
root@controller
START with options: ['-v', 'stack', 'create', '-t', 'my-temp1.yaml', '--dry-run', 'mystack']
command: stack create -> heatclient.
/usr/lib/
auth_plugin_class = base.get_
Using auth plugin: password
/usr/lib/
'in future releases.', DeprecationWarning)
/usr/lib/
'removed in future releases.', DeprecationWarning)
datetime.date(2016, 10, 14) is not JSON serializable
END return value: 1
root@controller
root@controller