Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
Node Group Templates dialog improvement
Browse files Browse the repository at this point in the history
No floating ip pool option is default now while creating a template

Copy template dialog now sets initial value for floating ip pool
correctly.

Change-Id: Icc0cb29f4417b9c2463d261ee3bbbb860615883d
Fixes: bug #1246893
  • Loading branch information
Konovalov-Nik committed Nov 27, 2013
1 parent a903d2b commit 1d8ca98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
3 changes: 3 additions & 0 deletions savannadashboard/nodegroup_templates/workflows/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def __init__(self, request, context_seed, entry_point, *args, **kwargs):
fields["volumes_per_node"].initial = volumes_per_node
fields["volumes_size"].initial = volumes_size

if template.floating_ip_pool:
fields['floating_ip_pool'].initial = template.floating_ip_pool

processes_dict = dict()
plugin_details = savanna.plugins.get_version_details(
plugin,
Expand Down
16 changes: 5 additions & 11 deletions savannadashboard/nodegroup_templates/workflows/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,13 @@ def __init__(self, request, *args, **kwargs):
(str(service) + ":" + str(process), process))

if not savannaclient.AUTO_ASSIGNMENT_ENABLED:
pools = []
pools.append((None, "Do not assign floating IPs"))

pools_list = network.floating_ip_pools_list(request)
first_pool_id = None
for pool in pools_list:
if not first_pool_id:
first_pool_id = pool.id
pools.append((pool.id, pool.name))
pools = network.floating_ip_pools_list(request)
pool_choices = [(pool.name, pool.name) for pool in pools]
pool_choices.insert(0, (None, "Do not assign floating IPs"))

self.fields['floating_ip_pool'] = forms.ChoiceField(
label=_("Floationg IP pool"),
choices=pools,
initial=first_pool_id,
choices=pool_choices,
required=False)

self.fields["processes"] = forms.MultipleChoiceField(
Expand Down

0 comments on commit 1d8ca98

Please sign in to comment.