<div dir="ltr">Hi Timur,<div><br></div><div style>Really appreciate your reply.</div><div style>Will try your suggestions.</div><div style><br></div><div style>Thanks,</div><div style>Nader.</div><div style><br></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 3, 2014 at 4:22 AM, Timur Sufiev <span dir="ltr"><<a href="mailto:tsufiev@mirantis.com" target="_blank">tsufiev@mirantis.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, Nader!<br>
<br>
As for `contributes` attribute, you could override `contribute(self,<br>
data, context)` method in your descendant of `workflows.Step` which by<br>
default simply iterates over all keys in `contributes`.<br>
<br>
Either you could use even more flexible approach (which also fits for<br>
`default_steps`): define in your `workflows.Step` descendants methods<br>
`contributes(self)` and `default_steps(self)` (with the conditional<br>
logic you need) and then decorate them with @property.<br>
<div><div class="h5"><br>
On Fri, May 30, 2014 at 10:15 AM, Nader Lahouti <<a href="mailto:nader.lahouti@gmail.com">nader.lahouti@gmail.com</a>> wrote:<br>
> Hi All,<br>
><br>
> Currently in the<br>
> horizon/openstack_dashboard/dashboards/project/networks/workflows.py in<br>
> classes such as CreateNetwork, CreateNetworkInfo and CreateSubnetInfo, the<br>
> contributes or default_steps as shown below are fixed. Is it possible to add<br>
> entries to those attributes conditionally?<br>
><br>
> 156class CreateSubnetInfo(workflows.Step):<br>
> 157    action_class = CreateSubnetInfoAction<br>
> 158    contributes = ("with_subnet", "subnet_name", "cidr",<br>
> 159                   "ip_version", "gateway_ip", "no_gateway")<br>
> 160<br>
><br>
> 262class CreateNetwork(workflows.Workflow):<br>
> 263    slug = "create_network"<br>
> 264    name = _("Create Network")<br>
> 265    finalize_button_name = _("Create")<br>
> 266    success_message = _('Created network "%s".')<br>
> 267    failure_message = _('Unable to create network "%s".')<br>
> 268    default_steps = (CreateNetworkInfo,<br>
> 269                     CreateSubnetInfo,<br>
> 270                     CreateSubnetDetail)<br>
><br>
> Thanks for your input.<br>
><br>
> Nader.<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> OpenStack-dev mailing list<br>
> <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Timur Sufiev<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</font></span></blockquote></div><br></div>