components/openstack/horizon/patches/06-launchpad-1255136.patch
changeset 3998 5bd484384122
parent 3997 0ca3f3d6c919
child 4002 95b8f35fcdd5
equal deleted inserted replaced
3997:0ca3f3d6c919 3998:5bd484384122
     1 Although the following patch has been addressed in Icehouse 2014.1, it
       
     2 still has not yet been released for Havana.  It has been modified to
       
     3 apply cleanly into our current Havana implementation
       
     4 
       
     5 From 1b13a42b9edbd34e8bb4339a962cd2c30bda7d81 Mon Sep 17 00:00:00 2001
       
     6 From: Zhenguo Niu <[email protected]>
       
     7 Date: Wed, 4 Dec 2013 09:45:56 +0800
       
     8 Subject: [PATCH] Set can_set_mount_point default to False
       
     9 
       
    10 Patch https://review.openstack.org/#/c/59229/ only changed the default
       
    11 value in the local_settings.py example file. If the setting isn't defined,
       
    12 it still defaults to True
       
    13 Change-Id: Ia3525786e5eb9ec83b8057c1cb6158ab153adc59
       
    14 Closes-Bug: #1255136
       
    15 
       
    16 --- horizon-2013.2.3/doc/source/topics/settings.rst.orig	2014-06-20 05:00:21.858630069 -0700
       
    17 +++ horizon-2013.2.3/doc/source/topics/settings.rst	2014-06-20 06:27:39.151996410 -0700
       
    18 @@ -204,14 +204,15 @@
       
    19  ``OPENSTACK_HYPERVISOR_FEATURES``
       
    20  ---------------------------------
       
    21  
       
    22 -Default: ``{'can_set_mount_point': True, 'can_encrypt_volumes': False}``
       
    23 +Default: ``{'can_set_mount_point': False, 'can_encrypt_volumes': False}``
       
    24  
       
    25  A dictionary containing settings which can be used to identify the
       
    26  capabilities of the hypervisor for Nova.
       
    27  
       
    28 -Some hypervisors have the ability to set the mount point for volumes attached
       
    29 -to instances (KVM does not). Setting ``can_set_mount_point`` to ``False`` will
       
    30 -remove the option to set the mount point from the UI.
       
    31 +The Xen Hypervisor has the ability to set the mount point for volumes attached
       
    32 +to instances (other Hypervisors currently do not). Setting
       
    33 +``can_set_mount_point`` to ``True`` will add the option to set the mount point
       
    34 +from the UI.
       
    35  
       
    36  In the Havana release, there will be a feature for encrypted volumes
       
    37  which will be controlled by the ``can_encrypt_volumes``. Setting it to ``True``
       
    38 --- horizon-2013.2.3/openstack_dashboard/dashboards/project/volumes/tests.py.orig	2014-06-20 04:56:16.805828523 -0700
       
    39 +++ horizon-2013.2.3/openstack_dashboard/dashboards/project/volumes/tests.py	2014-06-20 06:32:26.947240676 -0700
       
    40 @@ -555,6 +555,8 @@
       
    41  
       
    42      @test.create_stubs({cinder: ('volume_get',), api.nova: ('server_list',)})
       
    43      def test_edit_attachments(self):
       
    44 +        PREV = settings.OPENSTACK_HYPERVISOR_FEATURES['can_set_mount_point']
       
    45 +        settings.OPENSTACK_HYPERVISOR_FEATURES['can_set_mount_point'] = True
       
    46          volume = self.volumes.first()
       
    47          servers = [s for s in self.servers.list()
       
    48                     if s.tenant_id == self.request.user.tenant_id]
       
    49 @@ -573,11 +575,10 @@
       
    50          self.assertEqual(res.status_code, 200)
       
    51          self.assertTrue(isinstance(form.fields['device'].widget,
       
    52                                     widgets.TextInput))
       
    53 +        settings.OPENSTACK_HYPERVISOR_FEATURES['can_set_mount_point'] = PREV
       
    54  
       
    55      @test.create_stubs({cinder: ('volume_get',), api.nova: ('server_list',)})
       
    56      def test_edit_attachments_cannot_set_mount_point(self):
       
    57 -        PREV = settings.OPENSTACK_HYPERVISOR_FEATURES['can_set_mount_point']
       
    58 -        settings.OPENSTACK_HYPERVISOR_FEATURES['can_set_mount_point'] = False
       
    59  
       
    60          volume = self.volumes.first()
       
    61          servers = [s for s in self.servers.list()
       
    62 @@ -593,7 +594,6 @@
       
    63          form = res.context['form']
       
    64          self.assertTrue(isinstance(form.fields['device'].widget,
       
    65                                     widgets.HiddenInput))
       
    66 -        settings.OPENSTACK_HYPERVISOR_FEATURES['can_set_mount_point'] = PREV
       
    67  
       
    68      @test.create_stubs({cinder: ('volume_get',),
       
    69                          api.nova: ('server_get', 'server_list',),
       
    70 --- horizon-2013.2.3/openstack_dashboard/dashboards/project/volumes/forms.py.orig	2014-06-20 04:54:21.534957784 -0700
       
    71 +++ horizon-2013.2.3/openstack_dashboard/dashboards/project/volumes/forms.py	2014-06-20 06:33:14.199293693 -0700
       
    72 @@ -230,7 +230,7 @@
       
    73                                        "OPENSTACK_HYPERVISOR_FEATURES",
       
    74                                        {})
       
    75          can_set_mount_point = hypervisor_features.get("can_set_mount_point",
       
    76 -                                                      True)
       
    77 +                                                      False)
       
    78          if not can_set_mount_point:
       
    79              self.fields['device'].widget = forms.widgets.HiddenInput()
       
    80              self.fields['device'].required = False
       
    81 --- horizon-2013.2.3/openstack_dashboard/local/local_settings.py.example.orig	2014-06-20 06:49:38.061148762 -0700
       
    82 +++ horizon-2013.2.3/openstack_dashboard/local/local_settings.py.example	2014-06-20 03:03:06.949623969 -0700
       
    83 @@ -149,8 +149,12 @@
       
    84      'can_edit_role': True
       
    85  }
       
    86  
       
    87 +# The Xen Hypervisor has the ability to set the mount point for volumes
       
    88 +# attached to instances (other Hypervisors currently do not). Setting
       
    89 +# can_set_mount_point to True will add the option to set the mount point
       
    90 +# from the UI.
       
    91  OPENSTACK_HYPERVISOR_FEATURES = {
       
    92 -    'can_set_mount_point': True,
       
    93 +    'can_set_mount_point': False,
       
    94  }
       
    95  
       
    96  # The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional
       
    97 --- horizon-2013.2.3/openstack_dashboard/test/settings.py.orig	2014-06-20 04:59:02.205734858 -0700
       
    98 +++ horizon-2013.2.3/openstack_dashboard/test/settings.py	2014-06-20 06:28:57.101070812 -0700
       
    99 @@ -107,7 +107,7 @@
       
   100  }
       
   101  
       
   102  OPENSTACK_HYPERVISOR_FEATURES = {
       
   103 -    'can_set_mount_point': True,
       
   104 +    'can_set_mount_point': False,
       
   105  }
       
   106  
       
   107  OPENSTACK_IMAGE_BACKEND = {