diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-02-17 10:39:45 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-02-17 10:39:45 +0000 |
commit | b353f7a8c60970f77f7d03fda33385c299744570 (patch) | |
tree | 1fa00725bf348bb943c9c80eaa1e7791f5475818 | |
parent | 938a61977bfe5446fedf5218ebc57fc03a404064 (diff) | |
parent | 16626f5c9e4ed28b877a04aa5415cf3013721ce0 (diff) | |
download | tuskar-ui-b353f7a8c60970f77f7d03fda33385c299744570.tar.gz |
Merge "Do not display warnings for unused roles"
-rw-r--r-- | tuskar_ui/infrastructure/overview/forms.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tuskar_ui/infrastructure/overview/forms.py b/tuskar_ui/infrastructure/overview/forms.py index 915fdfb7..b69169f9 100644 --- a/tuskar_ui/infrastructure/overview/forms.py +++ b/tuskar_ui/infrastructure/overview/forms.py @@ -68,21 +68,22 @@ def validate_plan(request, plan): requested_nodes = 0 previous_snmp_password = None for role in plan.role_list: - if role.image(plan) is None: + node_count = plan.get_role_node_count(role) + if node_count and role.image(plan) is None: messages.append({ 'text': _(u"Role {0} has no image.").format(role.name), 'is_critical': True, 'link_url': reverse_lazy('horizon:infrastructure:roles:index'), 'link_label': _(u"Associate this role with an image."), }) - if role.flavor(plan) is None: + if node_count and role.flavor(plan) is None: messages.append({ 'text': _(u"Role {0} has no flavor.").format(role.name), 'is_critical': False, 'link_url': reverse_lazy('horizon:infrastructure:roles:index'), 'link_label': _(u"Associate this role with a flavor."), }) - requested_nodes += plan.get_role_node_count(role) + requested_nodes += node_count snmp_password = plan.parameter_value( role.parameter_prefix + 'SnmpdReadonlyUserPassword') if (not snmp_password or |