Merge "Use "flavor" service attribute to select OpenStack flavor"
This commit is contained in:
commit
e3a34f0246
@ -95,22 +95,27 @@ class Workflow(object):
|
|||||||
return position + suffix.split('.')
|
return position + suffix.split('.')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _select_func(context, path='', source=None, **kwargs):
|
def _select_func(context, path='', source=None, default=None, **kwargs):
|
||||||
|
|
||||||
|
result = None
|
||||||
if path.startswith('##'):
|
if path.startswith('##'):
|
||||||
config = context['/config']
|
config = context['/config']
|
||||||
return config[path[2:]]
|
result = config[path[2:]]
|
||||||
elif path.startswith('#'):
|
elif path.startswith('#'):
|
||||||
return context[path[1:]]
|
result = context[path[1:]]
|
||||||
|
elif source is not None:
|
||||||
if source is not None:
|
result = Workflow._get_path(
|
||||||
return Workflow._get_path(
|
|
||||||
context[source], path.split('.'))
|
context[source], path.split('.'))
|
||||||
else:
|
else:
|
||||||
return Workflow._get_path(
|
result = Workflow._get_path(
|
||||||
context['/dataSource'],
|
context['/dataSource'],
|
||||||
Workflow._correct_position(path, context))
|
Workflow._correct_position(path, context))
|
||||||
|
|
||||||
|
if not result and default is not None:
|
||||||
|
result = default
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _set_func(path, context, body, engine, target=None, **kwargs):
|
def _set_func(path, context, body, engine, target=None, **kwargs):
|
||||||
body_data = engine.evaluate_content(body, context)
|
body_data = engine.evaluate_content(body, context)
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
</parameter>
|
</parameter>
|
||||||
<parameter name="arguments">
|
<parameter name="arguments">
|
||||||
<map>
|
<map>
|
||||||
<argument name="InstanceType">m1.medium</argument>
|
<argument name="InstanceType"><select path="::flavor" default="m1.medium"/></argument>
|
||||||
<argument name="ImageName">ws-2012-full</argument>
|
<argument name="ImageName">ws-2012-full</argument>
|
||||||
</map>
|
</map>
|
||||||
</parameter>
|
</parameter>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
</parameter>
|
</parameter>
|
||||||
<parameter name="arguments">
|
<parameter name="arguments">
|
||||||
<map>
|
<map>
|
||||||
<argument name="InstanceType">m1.medium</argument>
|
<argument name="InstanceType"><select path="::flavor" default="m1.medium"/></argument>
|
||||||
<argument name="ImageName">ws-2012-full</argument>
|
<argument name="ImageName">ws-2012-full</argument>
|
||||||
</map>
|
</map>
|
||||||
</parameter>
|
</parameter>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
</parameter>
|
</parameter>
|
||||||
<parameter name="arguments">
|
<parameter name="arguments">
|
||||||
<map>
|
<map>
|
||||||
<argument name="InstanceType">m1.medium</argument>
|
<argument name="InstanceType"><select path="::flavor" default="m1.medium"/></argument>
|
||||||
<argument name="ImageName">ws-2012-full</argument>
|
<argument name="ImageName">ws-2012-full</argument>
|
||||||
</map>
|
</map>
|
||||||
</parameter>
|
</parameter>
|
||||||
|
Loading…
Reference in New Issue
Block a user