[openstack-dev] [murano] MuranoPL types question
Paul Bourke
paul.bourke at oracle.com
Thu Mar 30 17:17:51 UTC 2017
Hi Stan,
I had a quick(hopefully) question about MuranoPL that I hope you might
be able to help with, Felipe had mentioned you are very knowledgeable in
this area. If you don't have time please disregard!
I'm working on a patch for the Murano core library to make volume
attachment info available, which is available at
https://review.openstack.org/451909. It's mostly working, but I'm having
some issues getting the types correct in MuranoPL to make this info
consumable by end users.
The attachment info from a sample run in the stack $outputs looks like
this (taken from the dashboard using $reporter)
u'vol-7c8ee61f-a444-46a1-ad70-fc6fce6a7b56-attachments':
u"[{u'server_id': u'2891067b-e7bb-4ab9-a759-9e81096c0682',
u'attachment_id': u'7456a4b0-3abd-48a0-a0cb-f3fa0f2706bb',
u'attached_at': u'2017-03-30T16:51:57.000000', u'host_name': None,
u'volume_id': u'373e4a5a-46b6-4091-82d6-b3dba62d552b', u'device':
u'/dev/vda', u'id': u'373e4a5a-46b6-4091-82d6-b3dba62d552b'}]"
Here both key and value appear to be a string (note, I can't confirm
this as the typeinfo function doesn't appear to be available in
Instance.yaml for some reason... perhaps I'm using it wrong)
My goal is to then set this into a property of CinderVolume.yaml, with a
Contract of '[]'. However, when I access this from a sample app, I end
up with a list of strings, shown by $reporter as:
(u"[{u'server_id': u'2891067b-e7bb-4ab9-a759-9e81096c0682',
u'attachment_id': u'f5bd50ab-4040-4e2b-8b50-790781d9bc37',
u'attached_at': u'2017-03-30T16:51:59.000000', u'host_name': None,
u'volume_id': u'ed7eb535-9e81-4c97-b063-86936d4ee306', u'device':
u'/dev/vdb', u'id': u'ed7eb535-9e81-4c97-b063-86936d4ee306'}]",)
So my question is:
1) Why is the content of this 'get_attr' coming from heat being stored
in the stack outputs as a string, and
2) Is there a way I can cast this to a list of dicts or similar
structure so it can be iterated as expected?
Any tips much appreciated.
Thanks,
-Paul
More information about the OpenStack-dev
mailing list