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