]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Increase the 3PAR hostname length
authorWalter A. Boring IV <walter.boring@hp.com>
Thu, 18 Sep 2014 19:03:46 +0000 (12:03 -0700)
committerWalter A. Boring IV <walter.boring@hp.com>
Fri, 19 Sep 2014 16:24:35 +0000 (09:24 -0700)
The latest 3PAR firmware supports a hostname of 31 characters.
This patch increases the hostname on the 3PAR from 23 characters to
31.

The driver currently has a fallback mechanism in place for detecting
existing hosts.   This handles the case where upgrading from
Icehouse to Juno where Icehouse hosts have a limit of 23 characters.

Change-Id: I171e54b2e03a4ae11d2bf07c9c48febab268ce84
Closes-Bug: 1371242

cinder/tests/test_hp3par.py
cinder/volume/drivers/san/hp/hp_3par_common.py

index 3861a168a1b82408f706a30ee14f7499609d7fb0..8a0a70a95676298f0fa09fbb843e65df8f36f60b 100644 (file)
@@ -27,6 +27,7 @@ from cinder.openstack.common import log as logging
 from cinder.openstack.common import units
 from cinder import test
 from cinder.tests import fake_hp_3par_client as hp3parclient
+from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon
 from cinder.volume.drivers.san.hp import hp_3par_fc as hpfcdriver
 from cinder.volume.drivers.san.hp import hp_3par_iscsi as hpdriver
 from cinder.volume import qos_specs
@@ -1935,6 +1936,13 @@ class HP3PARBaseDriver(object):
 
         mock_client.assert_has_calls(expected)
 
+    def test__safe_hostname(self):
+        long_hostname = "abc123abc123abc123abc123abc123abc123"
+        fixed_hostname = "abc123abc123abc123abc123abc123a"
+        common = hpcommon.HP3PARCommon(None)
+        safe_host = common._safe_hostname(long_hostname)
+        self.assertEqual(fixed_hostname, safe_host)
+
 
 class TestHP3PARFCDriver(HP3PARBaseDriver, test.TestCase):
 
index 9d3d976253ed1df19d1616f522ab4b0a334fa27d..7681635261c33a327af73f567da2f3a421811f1b 100644 (file)
@@ -150,10 +150,11 @@ class HP3PARCommon(object):
         2.0.20 - Configurable SSH missing key policy and known hosts file
         2.0.21 - Remove bogus invalid snapCPG=None exception
         2.0.22 - HP 3PAR drivers should not claim to have 'infinite' space
+        2.0.23 - Increase the hostname size from 23 to 31  Bug #1371242
 
     """
 
-    VERSION = "2.0.22"
+    VERSION = "2.0.23"
 
     stats = {}
 
@@ -561,8 +562,8 @@ class HP3PARCommon(object):
             index = len(hostname)
 
         # we'll just chop this off for now.
-        if index > 23:
-            index = 23
+        if index > 31:
+            index = 31
 
         return hostname[:index]