Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.45 KB | None | 0 0
  1. diff --git a/cinder/volume/drivers/ibm/ibm_storage/__init__.py b/cinder/volume/drivers/ibm/ibm_storage/__init__.py
  2. index 498521f..317e0ce 100644
  3. --- a/cinder/volume/drivers/ibm/ibm_storage/__init__.py
  4. +++ b/cinder/volume/drivers/ibm/ibm_storage/__init__.py
  5. @@ -13,7 +13,6 @@
  6. # License for the specific language governing permissions and limitations
  7. # under the License.
  8. #
  9. -import neobunch
  10.  
  11. BLOCKS_PER_17_GIGABYTES = 33554432.0
  12. XIV_LOG_PREFIX = "[IBM XIV STORAGE]:"
  13. @@ -26,7 +25,7 @@ STORAGE_DRIVER_XIV = 'xiv'
  14. STORAGE_DRIVER_DS8K = 'ds8k'
  15.  
  16.  
  17. -CONF_KEYS = neobunch.NeoBunch(
  18. +CONF_KEYS = dict(
  19. driver="volume_driver",
  20. proxy="proxy",
  21. user="san_login",
  22. @@ -42,7 +41,7 @@ CONF_KEYS = neobunch.NeoBunch(
  23. system_id='system_id',
  24. replication_device='replication_device'
  25. )
  26. -CONF_BACKEND_KEYS = neobunch.NeoBunch(
  27. +CONF_BACKEND_KEYS = dict(
  28. user="san_login",
  29. password="san_password",
  30. storage_pool="san_clustername",
  31. @@ -51,7 +50,7 @@ CONF_BACKEND_KEYS = neobunch.NeoBunch(
  32. connection_type="connection_type",
  33. management_ips="management_ips",
  34. )
  35. -FLAG_KEYS = neobunch.NeoBunch(
  36. +FLAG_KEYS = dict(
  37. user="user",
  38. password="password",
  39. storage_pool="vol_pool",
  40. @@ -60,7 +59,7 @@ FLAG_KEYS = neobunch.NeoBunch(
  41. bypass_connection_check="XIV_BYPASS_CONNECTION_CHECK",
  42. management_ips="management_ips"
  43. )
  44. -METADATA_KEYS = neobunch.NeoBunch(
  45. +METADATA_KEYS = dict(
  46. ibm_storage_version='openstack_ibm_storage_driver_version',
  47. openstack_version='openstack_version',
  48. pool_host_key='openstack_compute_node_%(hostname)s',
  49. @@ -107,7 +106,7 @@ def get_online_iscsi_ports(ibm_storage_cli):
  50. """Returns online iscsi ports"""
  51.  
  52. iscsi_ports = [
  53. - neobunch.NeoBunch(
  54. + dict(
  55. {
  56. 'ip': p.address,
  57. # ipinterface_list returns ports field in Gen3, and
  58. @@ -118,7 +117,7 @@ def get_online_iscsi_ports(ibm_storage_cli):
  59. if p.type == 'iSCSI']
  60.  
  61. iscsi_connected_ports = [
  62. - neobunch.NeoBunch(
  63. + dict(
  64. {
  65. 'port': p.index,
  66. 'module': p.module_id
  67. @@ -129,8 +128,8 @@ def get_online_iscsi_ports(ibm_storage_cli):
  68. for ip in iscsi_ports:
  69. if len([
  70. p for p in iscsi_connected_ports
  71. - if p.port == ip.port and p.module == ip.module
  72. + if p['port'] == ip['port'] and p['module'] == ip['module']
  73. ]) > 0:
  74. - to_return += [ip.ip]
  75. + to_return += [ip['ip']]
  76.  
  77. return to_return
  78. diff --git a/cinder/volume/drivers/ibm/ibm_storage/proxy.py b/cinder/volume/drivers/ibm/ibm_storage/proxy.py
  79. index cd9b077..65cf112 100644
  80. --- a/cinder/volume/drivers/ibm/ibm_storage/proxy.py
  81. +++ b/cinder/volume/drivers/ibm/ibm_storage/proxy.py
  82. @@ -18,8 +18,6 @@ import gettext
  83. import inspect
  84. import platform
  85.  
  86. -import neobunch
  87. -
  88. from cinder.i18n import _LE
  89. from cinder import version
  90. from cinder import volume as c_volume
  91. @@ -80,12 +78,12 @@ class IBMStorageProxy(object):
  92. """Initialize Proxy."""
  93.  
  94. self.storage_info = storage_info
  95. - self.meta = neobunch.NeoBunch()
  96. + self.meta = dict()
  97. self.logger = logger
  98.  
  99. - self.meta.exception = exception
  100. - self.meta.openstack_version = "cinder-%s" % version.version_string()
  101. - self.meta.stat = None
  102. + self.meta['exception'] = exception
  103. + self.meta['openstack_version']] = "cinder-%s" % version.version_string()
  104. + self.meta['stat'] = None
  105. self.driver = driver
  106. self.full_version = "%(title)s (v%(version)s)" % {
  107. 'title': strings.TITLE,
  108. @@ -93,9 +91,9 @@ class IBMStorageProxy(object):
  109. self.active_backend_id = active_backend_id
  110. self.targets = {}
  111. self._read_replication_devices()
  112. - self.meta.bypass_connection_check = (
  113. + self.meta['bypass_connection_check'] = (
  114. self._get_safely_from_configuration(
  115. - storage.FLAG_KEYS.bypass_connection_check, False))
  116. + storage.FLAG_KEYS['bypass_connection_check'], False))
  117.  
  118. @_trace_time
  119. def setup(self, context):
  120. @@ -169,9 +167,9 @@ class IBMStorageProxy(object):
  121. @_trace_time
  122. def get_volume_stats(self, refresh=False):
  123. """get volume stats."""
  124. - if self.meta.stat is None or refresh:
  125. + if self.meta['stat'] is None or refresh:
  126. self._update_stats()
  127. - return self.meta.stat
  128. + return self.meta['stat']
  129.  
  130. @_trace_time
  131. def _update_stats(self):
  132. @@ -213,7 +211,7 @@ class IBMStorageProxy(object):
  133. pass
  134.  
  135. @_trace_time
  136. - def _get_bunch_from_host(
  137. + def _get_host_info(
  138. self, connector, host_id=0, host_name=None, chap=None):
  139. """Get's a Bunch describing a host"""
  140. if not host_name:
  141. @@ -225,14 +223,13 @@ class IBMStorageProxy(object):
  142. if len(wwpns) == 0 and "wwnns" in connector:
  143. wwpns = connector.get("wwns", [])
  144.  
  145. - return neobunch.NeoBunch(
  146. - {
  147. + return {
  148. 'name': current_host_name,
  149. 'initiator': initiator,
  150. 'id': host_id,
  151. 'wwpns': wwpns,
  152. 'chap': chap,
  153. - })
  154. + }
  155.  
  156. @_trace_time
  157. def _get_os_type(self):
  158. @@ -249,7 +246,7 @@ class IBMStorageProxy(object):
  159.  
  160. def _get_exception(self):
  161. """Get's Cinder exception"""
  162. - return self.meta.exception.CinderException
  163. + return self.meta['exception'].CinderException
  164.  
  165. def _get_code_and_status_or_message(self, exception):
  166. """Returns status message
  167. @@ -277,7 +274,7 @@ class IBMStorageProxy(object):
  168. :returns: iscsi|fibre_channel
  169. """
  170. return self._get_safely_from_configuration(
  171. - storage.CONF_KEYS.connection_type,
  172. + storage.CONF_KEYS['connection_type'],
  173. default=storage.XIV_CONNECTION_TYPE_ISCSI)
  174.  
  175. def _is_iscsi(self):
  176. @@ -288,7 +285,7 @@ class IBMStorageProxy(object):
  177. def _get_management_ips(self):
  178. """Gets the management IP addresses from conf"""
  179. return self._get_safely_from_configuration(
  180. - storage.CONF_KEYS.management_ips,
  181. + storage.CONF_KEYS['management_ips'],
  182. default='')
  183.  
  184. def _get_chap_type(self):
  185. @@ -297,9 +294,9 @@ class IBMStorageProxy(object):
  186. :returns: disabled|enabled
  187. """
  188. LOG.debug("_get_chap_type chap: %(chap)s",
  189. - {'chap': storage.CONF_KEYS.chap})
  190. + {'chap': storage.CONF_KEYS['chap']})
  191. return self._get_safely_from_configuration(
  192. - storage.CONF_KEYS.chap,
  193. + storage.CONF_KEYS['chap'],
  194. default=storage.CHAP_NONE)
  195.  
  196. def _get_safely_from_configuration(self, key, default=None):
  197. diff --git a/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py b/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py
  198. index 15cd302..d361965 100644
  199. --- a/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py
  200. +++ b/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py
  201. @@ -17,7 +17,6 @@ import datetime
  202. import six
  203. import socket
  204.  
  205. -import neobunch
  206. from pyxcli import client
  207. from pyxcli import errors
  208. from pyxcli.events import events
  209. @@ -341,18 +340,18 @@ class XIVProxy(proxy.IBMStorageProxy):
  210. return self._get_qos_specs(type_id)
  211.  
  212. def _get_replication_info(self, specs):
  213. - info = neobunch.NeoBunch({'enabled': False, 'mode': None, 'rpo': 0})
  214. + info = {'enabled': False, 'mode': None, 'rpo': 0}
  215. if specs:
  216. LOG.debug('_get_replication_info: specs %(specs)s',
  217. {'specs': specs})
  218. - info.enabled = specs.get(
  219. + info['enabled'] = specs.get(
  220. 'replication_enabled', '').upper() \
  221. in (u'TRUE', strings.METADATA_IS_TRUE)
  222. replication_type = specs.get('replication_type', SYNC).lower()
  223. if replication_type in (u'sync', u'<is> sync'):
  224. - info.mode = SYNC
  225. + info['mode'] = SYNC
  226. elif replication_type in (u'async', u'<is> async'):
  227. - info.mode = ASYNC
  228. + info['mode'] = ASYNC
  229. else:
  230. msg = ('_get_replication_info: invalid '
  231. 'replication type %(info)s' %
  232. @@ -361,15 +360,15 @@ class XIVProxy(proxy.IBMStorageProxy):
  233. raise self._get_exception()(
  234. message=strings.REPLICA_INVALID_MODE %
  235. {'mode': replication_type})
  236. - info.rpo = int(specs.get('rpo', u'<is> 0')[5:])
  237. - if info.rpo and info.rpo not in self._get_supported_rpo():
  238. + info['rpo'] = int(specs.get('rpo', u'<is> 0')[5:])
  239. + if info['rpo'] and info['rpo'] not in self._get_supported_rpo():
  240. msg = ('_get_replication_info: invalid '
  241. 'replication type %(info)s'
  242. '_get_replication_info: invalid rpo %(rpo)s' %
  243. - {'info': info, 'rpo': info.rpo})
  244. + {'info': info, 'rpo': info['rpo']})
  245. LOG.error(msg)
  246. raise self._get_exception()(
  247. - message=strings.REPLICA_INVALID_RPO % {'rpo': info.rpo})
  248. + message=strings.REPLICA_INVALID_RPO % {'rpo': info['rpo']})
  249. msg = ('_get_replication_info: info %(info)s' %
  250. {'info': info})
  251. LOG.debug(msg)
  252. @@ -382,7 +381,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  253. try:
  254. self._call_xiv_xcli(
  255. "vol_create", vol=volume['name'], size_blocks=size,
  256. - pool=self.storage_info[storage.FLAG_KEYS.storage_pool])
  257. + pool=self.storage_info[storage.FLAG_KEYS['storage_pool']])
  258. except errors.SystemOutOfSpaceError:
  259. msg = (strings.CREATE_VOLUME_BASE_ERROR,
  260. {'details': strings.CREATE_VOLUME_SYSTEM_OUT_OF_SPACE})
  261. @@ -392,7 +391,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  262. {'details': strings.CREATE_VOLUME_SYSTEM_OUT_OF_SPACE})
  263. except errors.PoolOutOfSpaceError:
  264. err = strings.CREATE_VOLUME_POOL_OUT_OF_SPACE % {
  265. - 'pool': self.storage_info[storage.FLAG_KEYS.storage_pool]}
  266. + 'pool': self.storage_info[storage.FLAG_KEYS['storage_pool']]}
  267. msg = (strings.CREATE_VOLUME_BASE_ERROR,
  268. {'details': err})
  269. LOG.error(msg)
  270. @@ -1238,7 +1237,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  271. "to fail back again.")
  272. LOG.info(msg)
  273. return self.active_backend_id, volume_update_list
  274. - pool_slave = self.storage_info[storage.FLAG_KEYS.storage_pool]
  275. + pool_slave = self.storage_info[storage.FLAG_KEYS['storage_pool']]
  276. pool_master = self._get_target_params(
  277. self.active_backend_id)['san_clustername']
  278. goal_status = 'available'
  279. @@ -1256,7 +1255,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  280. LOG.error(msg)
  281. raise self.meta.exception.VolumeBackendAPIException(
  282. data=msg)
  283. - pool_master = self.storage_info[storage.FLAG_KEYS.storage_pool]
  284. + pool_master = self.storage_info[storage.FLAG_KEYS['storage_pool']]
  285. try:
  286. pool_slave = self._get_target_params(
  287. secondary_id)['san_clustername']
  288. @@ -1265,7 +1264,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  289. LOG.error(msg)
  290. raise self.meta.exception.VolumeBackendAPIException(
  291. data=msg)
  292. - pool_master = self.storage_info[storage.FLAG_KEYS.storage_pool]
  293. + pool_master = self.storage_info[storage.FLAG_KEYS['storage_pool']]
  294. goal_status = objects.fields.ReplicationStatus.FAILED_OVER
  295.  
  296. # connnect xcli to secondary storage according to backend_id by
  297. @@ -1359,7 +1358,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  298. if (dest != strings.XIV_BACKEND_PREFIX or dest_host != volume_host):
  299. return False
  300.  
  301. - pool_name = self.storage_info[storage.FLAG_KEYS.storage_pool]
  302. + pool_name = self.storage_info[storage.FLAG_KEYS['storage_pool']]
  303.  
  304. # if pool is different. else - we're on the same pool and retype is ok.
  305. if (pool_name != dest_pool):
  306. @@ -1422,8 +1421,8 @@ class XIVProxy(proxy.IBMStorageProxy):
  307. self.meta.stat["volume_backend_name"] = backend_name or \
  308. '%s_%s_%s_%s' % (
  309. strings.XIV_BACKEND_PREFIX,
  310. - self.storage_info[storage.FLAG_KEYS.address],
  311. - self.storage_info[storage.FLAG_KEYS.storage_pool],
  312. + self.storage_info[storage.FLAG_KEYS['address']],
  313. + self.storage_info[storage.FLAG_KEYS['storage_pool']],
  314. connection_type)
  315. self.meta.stat["vendor_name"] = 'IBM'
  316. self.meta.stat["driver_version"] = self.full_version
  317. @@ -1435,17 +1434,17 @@ class XIVProxy(proxy.IBMStorageProxy):
  318. self.meta.stat['location_info'] =\
  319. ('%(destination)s:%(hostname)s:%(pool)s' %
  320. {'destination': strings.XIV_BACKEND_PREFIX,
  321. - 'hostname': self.storage_info[storage.FLAG_KEYS.address],
  322. - 'pool': self.storage_info[storage.FLAG_KEYS.storage_pool]
  323. + 'hostname': self.storage_info[storage.FLAG_KEYS['address']],
  324. + 'pool': self.storage_info[storage.FLAG_KEYS['storage_pool']]
  325. })
  326.  
  327. pools = self._call_xiv_xcli(
  328. "pool_list",
  329. - pool=self.storage_info[storage.FLAG_KEYS.storage_pool]).as_list
  330. + pool=self.storage_info[storage.FLAG_KEYS['storage_pool']]).as_list
  331. if len(pools) != 1:
  332. LOG.error(
  333. _LE("_update_stats: Pool %(pool)s not available on storage"),
  334. - {'pool': self.storage_info[storage.FLAG_KEYS.storage_pool]})
  335. + {'pool': self.storage_info[storage.FLAG_KEYS['storage_pool']]})
  336. return
  337. pool = pools[0]
  338.  
  339. @@ -1606,7 +1605,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  340. try:
  341. self._call_xiv_xcli(
  342. "cg_create", cg=cgname,
  343. - pool=self.storage_info[storage.FLAG_KEYS.storage_pool]).as_list
  344. + pool=self.storage_info[storage.FLAG_KEYS['storage_pool']]).as_list
  345. except errors.CgNameExistsError as e:
  346. error = "consistency group %s already exists on backend" % cgname
  347. LOG.error(error)
  348. @@ -2009,12 +2008,12 @@ class XIVProxy(proxy.IBMStorageProxy):
  349. """
  350.  
  351. if host:
  352. - if host.chap:
  353. - chap_name = host.chap[0]
  354. + if host['chap']:
  355. + chap_name = host['chap'][0]
  356. LOG.debug("_create_chap: %(chap_name)s ",
  357. {'chap_name': chap_name})
  358. else:
  359. - chap_name = host.name
  360. + chap_name = host['name']
  361. else:
  362. LOG.info(_LI("_create_chap: host missing!!!"))
  363. chap_name = "12345678901234"
  364. @@ -2028,7 +2027,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  365. """Returns a host looked up via initiator."""
  366.  
  367. try:
  368. - host_bunch = self._get_bunch_from_host(connector)
  369. + host_info = self._get_host_info(connector)
  370. except Exception as e:
  371. details = self._get_code_and_status_or_message(e)
  372. raise self._get_exception()(
  373. @@ -2040,11 +2039,11 @@ class XIVProxy(proxy.IBMStorageProxy):
  374. all_hosts = self._call_xiv_xcli("host_list").as_list
  375. if self._get_connection_type() == storage.XIV_CONNECTION_TYPE_ISCSI:
  376. host = [host_obj for host_obj in all_hosts
  377. - if host_bunch.initiator in host_obj.iscsi_ports.split(',')]
  378. + if host_info['initiator'] in host_obj.iscsi_ports.split(',')]
  379. else:
  380. if 'wwpns' in connector:
  381. - if len(host_bunch.wwpns) > 0:
  382. - wwpn_set = set([wwpn.lower() for wwpn in host_bunch.wwpns])
  383. + if len(host_info['wwpns']) > 0:
  384. + wwpn_set = set([wwpn.lower() for wwpn in host_info['wwpns']])
  385. host = [host for host in all_hosts if
  386. len(wwpn_set.intersection(host.get(
  387. 'fc_ports', '').lower().split(','))) > 0]
  388. @@ -2057,7 +2056,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  389. self._generate_chap_secret(host[0].iscsi_chap_name))
  390. LOG.debug("_get_host: chap_name %(chap_name)s ",
  391. {'chap_name': host[0].iscsi_chap_name})
  392. - return self._get_bunch_from_host(
  393. + return self._get_host_info(
  394. connector, host[0].id, host[0].name, chap)
  395.  
  396. LOG.debug("_get_host: returns None")
  397. @@ -2105,8 +2104,8 @@ class XIVProxy(proxy.IBMStorageProxy):
  398. chap_secret = None
  399. if (self._get_connection_type() == storage.XIV_CONNECTION_TYPE_ISCSI) \
  400. and (self._get_chap_type() == storage.CHAP_ENABLED):
  401. - host_bunch = neobunch.NeoBunch({'name': host, 'chap': None, })
  402. - chap = self._create_chap(host=host_bunch)
  403. + host_info = {'name': host, 'chap': None, }
  404. + chap = self._create_chap(host=host_info)
  405. chap_name = chap[0]
  406. chap_secret = chap[1]
  407. LOG.debug("_define_host_according_to_chap: %(name)s : %(secret)s",
  408. @@ -2117,20 +2116,20 @@ class XIVProxy(proxy.IBMStorageProxy):
  409. chap_secret=chap_secret,
  410. domain_name=in_domain)
  411.  
  412. - def _define_ports(self, host_bunch):
  413. + def _define_ports(self, host_info):
  414. """Defines ports in XIV."""
  415. fc_targets = []
  416. - LOG.debug(host_bunch.name)
  417. + LOG.debug(host_info['name'])
  418. if self._get_connection_type() == storage.XIV_CONNECTION_TYPE_ISCSI:
  419. - self._define_iscsi(host_bunch)
  420. + self._define_iscsi(host_info)
  421. else:
  422. - fc_targets = self._define_fc(host_bunch)
  423. + fc_targets = self._define_fc(host_info)
  424. fc_targets = list(set(fc_targets))
  425. fc_targets.sort(self._sort_last_digit)
  426. return fc_targets
  427.  
  428. def _get_pool_domain(self, connector):
  429. - pool_name = self.storage_info[storage.FLAG_KEYS.storage_pool]
  430. + pool_name = self.storage_info[storage.FLAG_KEYS['storage_pool']]
  431. LOG.debug("pool name from configuration: %s" % pool_name)
  432. domain = None
  433. try:
  434. @@ -2145,17 +2144,17 @@ class XIVProxy(proxy.IBMStorageProxy):
  435. def _define_host(self, connector):
  436. """Defines a host in XIV."""
  437. domain = self._get_pool_domain(connector)
  438. - host_bunch = self._get_bunch_from_host(connector)
  439. + host_info = self._get_host_info(connector)
  440. host = self._call_xiv_xcli(
  441. - "host_list", host=host_bunch.name).as_list
  442. + "host_list", host=host_info['name']).as_list
  443. connection_type = self._get_connection_type()
  444. if len(host) == 0:
  445. LOG.debug("Non existing host, defining")
  446. host = self._define_host_according_to_chap(
  447. - host=host_bunch.name, in_domain=domain)
  448. - host_bunch = self._get_bunch_from_host(connector, host.id)
  449. + host=host_info['name'], in_domain=domain)
  450. + host_info = self._get_host_info(connector, host.id)
  451. else:
  452. - host_bunch = self._get_bunch_from_host(connector, host[0].id)
  453. + host_info = self._get_host_info(connector, host[0].id)
  454. LOG.debug("Generating hostname for connector %(conn)s" %
  455. {'conn': connector})
  456. generated_hostname = storage.get_host_or_create_from_iqn(
  457. @@ -2169,19 +2168,19 @@ class XIVProxy(proxy.IBMStorageProxy):
  458. in_domain=domain)
  459. else:
  460. host = generated_host[0]
  461. - host_bunch = self._get_bunch_from_host(
  462. + host_info = self._get_host_info(
  463. connector, host.id, host_name=generated_hostname)
  464. - LOG.debug("The host_bunch : %s" % host_bunch)
  465. - return host_bunch
  466. + LOG.debug("The host_info : %s" % host_info)
  467. + return host_info
  468.  
  469. @proxy._trace_time
  470. - def _define_fc(self, host_bunch):
  471. + def _define_fc(self, host_info):
  472. """Define FC Connectivity."""
  473.  
  474. fc_targets = []
  475. - if len(host_bunch.wwpns) > 0:
  476. + if len(host_info['wwpns']) > 0:
  477. connected_wwpns = []
  478. - for wwpn in host_bunch.wwpns:
  479. + for wwpn in host_info['wwpns']:
  480. component_ids = list(set(
  481. [p.component_id for p in
  482. self._call_xiv_xcli(
  483. @@ -2200,7 +2199,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  484. fc_targets += wwpn_fc_target_lists
  485. LOG.debug("adding fc port %s" % wwpn)
  486. self._call_xiv_xcli(
  487. - "host_add_port", host=host_bunch.name,
  488. + "host_add_port", host=host_info['name'],
  489. fcaddress=wwpn)
  490. if len(connected_wwpns) == 0:
  491. LOG.error(strings.CONNECTIVITY_FC_NO_TARGETS)
  492. @@ -2211,13 +2210,13 @@ class XIVProxy(proxy.IBMStorageProxy):
  493. return fc_targets
  494.  
  495. @proxy._trace_time
  496. - def _define_iscsi(self, host_bunch):
  497. + def _define_iscsi(self, host_info):
  498. """Add iscsi ports."""
  499. - if host_bunch.initiator:
  500. + if host_info['initiator']:
  501. LOG.debug("adding iscsi")
  502. self._call_xiv_xcli(
  503. - "host_add_port", host=host_bunch.name,
  504. - iscsi_name=host_bunch.initiator)
  505. + "host_add_port", host=host_info['name'],
  506. + iscsi_name=host_info['initiator'])
  507. else:
  508. msg = _LE("No iSCSI initiator found!")
  509. LOG.error(msg)
  510. @@ -2229,7 +2228,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  511. LOG.debug("send event SERVICE_STARTED")
  512. service_start_evnt_prop = {
  513. "openstack_version": self.meta.openstack_version,
  514. - "pool_name": self.storage_info[storage.FLAG_KEYS.storage_pool]}
  515. + "pool_name": self.storage_info[storage.FLAG_KEYS['storage_pool]']}
  516. ev_mgr = events.EventsManager(self.ibm_storage_cli,
  517. OPENSTACK_PRODUCT_NAME,
  518. self.full_version)
  519. @@ -2242,7 +2241,7 @@ class XIVProxy(proxy.IBMStorageProxy):
  520. compute_host_name = socket.getfqdn()
  521. vol_attach_evnt_prop = {
  522. "openstack_version": self.meta.openstack_version,
  523. - "pool_name": self.storage_info[storage.FLAG_KEYS.storage_pool],
  524. + "pool_name": self.storage_info[storage.FLAG_KEYS['storage_pool']],
  525. "compute_hostname": compute_host_name}
  526.  
  527. ev_mgr = events.EventsManager(self.ibm_storage_cli,
  528. @@ -2400,11 +2399,11 @@ class XIVProxy(proxy.IBMStorageProxy):
  529. if not backend_id or backend_id == strings.PRIMARY_BACKEND_ID:
  530. if self._get_management_ips():
  531. address = [e.strip(" ") for e in self.storage_info[
  532. - storage.FLAG_KEYS.management_ips].split(",")]
  533. + storage.FLAG_KEYS['management_ips']].split(",")]
  534. else:
  535. - address = self.storage_info[storage.FLAG_KEYS.address]
  536. - user = self.storage_info[storage.FLAG_KEYS.user]
  537. - password = self.storage_info[storage.FLAG_KEYS.password]
  538. + address = self.storage_info[storage.FLAG_KEYS['address']]
  539. + user = self.storage_info[storage.FLAG_KEYS['user']]
  540. + password = self.storage_info[storage.FLAG_KEYS['password']]
  541. else:
  542. params = self._get_target_params(backend_id)
  543. if not params:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement