From 4d9f5e8ce88fc88b13b2b56eebe84cd97f2abf3e Mon Sep 17 00:00:00 2001 From: Gabriel Hurley Date: Thu, 8 Dec 2011 15:12:58 -0800 Subject: [PATCH] PEP8 fixes. Change-Id: If44db0308ff9975de510b84e27f2d9afa66b880e --- horizon/horizon/api/deprecated.py | 1 + horizon/horizon/dashboards/nova/volumes/forms.py | 5 +++-- horizon/horizon/dashboards/nova/volumes/views.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/horizon/horizon/api/deprecated.py b/horizon/horizon/api/deprecated.py index dc6beb02bb8..ebe6f082891 100644 --- a/horizon/horizon/api/deprecated.py +++ b/horizon/horizon/api/deprecated.py @@ -57,6 +57,7 @@ def inner(*args, **kwargs): raise return inner + def admin_api(request): management_url = url_for(request, 'compute', True) LOG.debug('admin_api connection created using token "%s"' diff --git a/horizon/horizon/dashboards/nova/volumes/forms.py b/horizon/horizon/dashboards/nova/volumes/forms.py index b642895831d..ee56faa55cf 100644 --- a/horizon/horizon/dashboards/nova/volumes/forms.py +++ b/horizon/horizon/dashboards/nova/volumes/forms.py @@ -65,7 +65,8 @@ def __init__(self, *args, **kwargs): super(AttachForm, self).__init__(*args, **kwargs) # populate volume_id volume_id = kwargs.get('initial', {}).get('volume_id', []) - self.fields['volume_id'] = forms.CharField(widget=forms.HiddenInput(), initial=volume_id) + self.fields['volume_id'] = forms.CharField(widget=forms.HiddenInput(), + initial=volume_id) # Populate instance choices instance_list = kwargs.get('initial', {}).get('instances', []) @@ -77,7 +78,7 @@ def __init__(self, *args, **kwargs): choices=instances, label="Attach to Instance", help_text="Select an instance to attach to.") - + def handle(self, request, data): try: api.volume_attach(request, diff --git a/horizon/horizon/dashboards/nova/volumes/views.py b/horizon/horizon/dashboards/nova/volumes/views.py index e153f6ccacc..4bacac42598 100644 --- a/horizon/horizon/dashboards/nova/volumes/views.py +++ b/horizon/horizon/dashboards/nova/volumes/views.py @@ -94,9 +94,9 @@ def create(request): @login_required -def attach(request, volume_id): +def attach(request, volume_id): instances = api.server_list(request) - attach_form, handled = AttachForm.maybe_handle(request, + attach_form, handled = AttachForm.maybe_handle(request, initial={'volume_id': volume_id, 'instances': instances})