From: Walter A. Boring IV Date: Thu, 18 Sep 2014 19:03:46 +0000 (-0700) Subject: Increase the 3PAR hostname length X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=6f74f92e4c5025ad577f3014e1cee0ea1c7506c0;p=openstack-build%2Fcinder-build.git Increase the 3PAR hostname length 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 --- diff --git a/cinder/tests/test_hp3par.py b/cinder/tests/test_hp3par.py index 3861a168a..8a0a70a95 100644 --- a/cinder/tests/test_hp3par.py +++ b/cinder/tests/test_hp3par.py @@ -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): diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index 9d3d97625..768163526 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -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]