summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-03-11 22:03:56 +0000
committerGerrit Code Review <review@openstack.org>2013-03-11 22:03:56 +0000
commitf5e30cf434eba64b415ee6c1d98111a198b4a7de (patch)
treebc8b7f79739ec773553d300af62801a962cd6b6c
parent348d333c947b3972c0b811ac65a44e06aec0242f (diff)
parent958b68fb801b1c87b1e2878738c1d74f1aae7dac (diff)
downloadnova-f5e30cf434eba64b415ee6c1d98111a198b4a7de.tar.gz
nova-f5e30cf434eba64b415ee6c1d98111a198b4a7de.tar.xz
nova-f5e30cf434eba64b415ee6c1d98111a198b4a7de.zip
Merge "Fixes volume attach on Hyper-V with IPv6"
-rw-r--r--nova/virt/hyperv/volumeutils.py7
-rw-r--r--nova/virt/hyperv/volumeutilsv2.py7
2 files changed, 8 insertions, 6 deletions
diff --git a/nova/virt/hyperv/volumeutils.py b/nova/virt/hyperv/volumeutils.py
index e77b463fe..55604bd52 100644
--- a/nova/virt/hyperv/volumeutils.py
+++ b/nova/virt/hyperv/volumeutils.py
@@ -27,6 +27,7 @@ from eventlet.green import subprocess
from oslo.config import cfg
from nova.openstack.common import log as logging
+from nova import utils
from nova.virt.hyperv import basevolumeutils
from nova.virt.hyperv import vmutils
@@ -55,9 +56,9 @@ class VolumeUtils(basevolumeutils.BaseVolumeUtils):
def login_storage_target(self, target_lun, target_iqn, target_portal):
"""Add target portal, list targets and logins to the target."""
- separator = target_portal.find(':')
- target_address = target_portal[:separator]
- target_port = target_portal[separator + 1:]
+ (target_address,
+ target_port) = utils.parse_server_string(target_portal)
+
#Adding target portal to iscsi initiator. Sending targets
self.execute('iscsicli.exe ' + 'AddTargetPortal ' +
target_address + ' ' + target_port +
diff --git a/nova/virt/hyperv/volumeutilsv2.py b/nova/virt/hyperv/volumeutilsv2.py
index 79d2d1876..cdc0803ee 100644
--- a/nova/virt/hyperv/volumeutilsv2.py
+++ b/nova/virt/hyperv/volumeutilsv2.py
@@ -29,6 +29,7 @@ if sys.platform == 'win32':
from oslo.config import cfg
from nova.openstack.common import log as logging
+from nova import utils
from nova.virt.hyperv import basevolumeutils
LOG = logging.getLogger(__name__)
@@ -45,9 +46,9 @@ class VolumeUtilsV2(basevolumeutils.BaseVolumeUtils):
def login_storage_target(self, target_lun, target_iqn, target_portal):
"""Add target portal, list targets and logins to the target."""
- separator = target_portal.find(':')
- target_address = target_portal[:separator]
- target_port = target_portal[separator + 1:]
+ (target_address,
+ target_port) = utils.parse_server_string(target_portal)
+
#Adding target portal to iscsi initiator. Sending targets
portal = self._conn_storage.MSFT_iSCSITargetPortal
portal.New(TargetPortalAddress=target_address,