summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Tomasek <jtomasek@redhat.com>2015-05-20 13:54:34 +0200
committerJiri Tomasek <jtomasek@redhat.com>2015-05-27 13:52:03 +0200
commitb93f81011f09cd3cc8bdaf595ca8e6437344314e (patch)
tree428ad24f110aa553c1a4702eff890c54702c86a3
parent7fcacc334fdc7411d62bd4a4ed23728867119c25 (diff)
downloadtuskar-ui-b93f81011f09cd3cc8bdaf595ca8e6437344314e.tar.gz
Simplified service config updates
Change-Id: Ied0a73435b04701f28092535924bf52edb2bb1b3
-rw-r--r--tuskar_ui/infrastructure/parameters/forms.py11
-rw-r--r--tuskar_ui/infrastructure/parameters/tests.py2
-rw-r--r--tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss3
-rw-r--r--tuskar_ui/infrastructure/templates/horizon/common/_horizontal_field.html4
4 files changed, 11 insertions, 9 deletions
diff --git a/tuskar_ui/infrastructure/parameters/forms.py b/tuskar_ui/infrastructure/parameters/forms.py
index 023dd2fa..cc31df57 100644
--- a/tuskar_ui/infrastructure/parameters/forms.py
+++ b/tuskar_ui/infrastructure/parameters/forms.py
@@ -225,17 +225,19 @@ class SimpleEditServiceConfig(horizon.forms.SelfHandlingForm):
# Set the same parameter and value in all roles.
for role in plan.role_list:
key = role.parameter_prefix + param_name
- params[key] = param_value
+ if key in [parameter.name
+ for parameter in role.parameter_list(plan)]:
+ params[key] = param_value
return params
def handle(self, request, data):
plan = api.tuskar.Plan.get_the_plan(self.request)
- compute_prefix = plan.get_role_by_name('compute').parameter_prefix
+ compute_prefix = plan.get_role_by_name('Compute').parameter_prefix
controller_prefix = plan.get_role_by_name(
- 'controller').parameter_prefix
+ 'Controller').parameter_prefix
cinder_prefix = plan.get_role_by_name(
- 'cinder-storage').parameter_prefix
+ 'Cinder-Storage').parameter_prefix
virt_type = data.get('virt_type')
neutron_public_interface = data.get('neutron_public_interface')
@@ -257,6 +259,7 @@ class SimpleEditServiceConfig(horizon.forms.SelfHandlingForm):
compute_prefix + 'NtpServer':
ntp_server,
}
+
parameters.update(self._load_additional_parameters(
plan, data,
'snmp_password', 'SnmpdReadonlyUserPassword'))
diff --git a/tuskar_ui/infrastructure/parameters/tests.py b/tuskar_ui/infrastructure/parameters/tests.py
index c4eb2bb9..0d008884 100644
--- a/tuskar_ui/infrastructure/parameters/tests.py
+++ b/tuskar_ui/infrastructure/parameters/tests.py
@@ -123,8 +123,6 @@ class ParametersTest(test.BaseAdminViewTests):
'Controller-1::CinderISCSIHelper': u'lioadm',
'Controller-1::NovaComputeLibvirtType': u'qemu',
'Compute-1::SnmpdReadonlyUserPassword': u'password',
- 'Block Storage-1::SnmpdReadonlyUserPassword': u'password',
- 'Object Storage-1::SnmpdReadonlyUserPassword': u'password',
'Controller-1::NtpServer': u'',
'Controller-1::ExtraConfig': u'{}',
'Compute-1::ExtraConfig': u'{}',
diff --git a/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss b/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss
index 33ada733..f0d6c346 100644
--- a/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss
+++ b/tuskar_ui/infrastructure/static/infrastructure/scss/_individual_pages.scss
@@ -269,6 +269,7 @@ ul.nav-arrow {
}
}
+// hacky positioning of advanced service config form buttons next to header
.page_form_actions {
- margin-top: -3.4em;
+ margin-top: -5em;
}
diff --git a/tuskar_ui/infrastructure/templates/horizon/common/_horizontal_field.html b/tuskar_ui/infrastructure/templates/horizon/common/_horizontal_field.html
index 96947c0a..f15f9284 100644
--- a/tuskar_ui/infrastructure/templates/horizon/common/_horizontal_field.html
+++ b/tuskar_ui/infrastructure/templates/horizon/common/_horizontal_field.html
@@ -1,8 +1,8 @@
{% load form_helpers %}
<div class="form-group{% if field.errors %} has-error{% endif %} {{ field.css_classes }}">
- <label class="control-label col-sm-3 {% if field.field.required or field.field.parameter.is_required %}{{ form.required_css_class }}{% endif %}" for="{{ field.id_for_label }}">{{ field.label }}</label>
- <div class="col-sm-9 {{ classes.value }} {{ field|wrapper_classes }}">
+ <label class="control-label col-lg-4 col-md-5 {% if field.field.required or field.field.parameter.is_required %}{{ form.required_css_class }}{% endif %}" for="{{ field.id_for_label }}">{{ field.label }}</label>
+ <div class="col-lg-8 col-md-7 {{ classes.value }} {{ field|wrapper_classes }}">
{{ field|add_bootstrap_class }}
{% for error in field.errors %}
<span class="help-block alert alert-danger {{ form.error_css_class }}">{{ error }}</span>