cinder-rtstool: should use acl.node_wwn
In newer version of rtslib module, NodeACL is now an object, not a dict. Thus, acl.node_wwn must be used instead of acl['node_wwn'], otherwise it will fail with exception. Change-Id: I0fb53596a2a99609aa4d573f1254b3afa7d9fd91 Closes-Bug: #1408443
This commit is contained in:
parent
00b03b90cc
commit
65d9c20b45
|
@ -100,7 +100,7 @@ def add_initiator(target_iqn, initiator_iqn, userid, password):
|
||||||
tpg = target.tpgs.next() # get the first one
|
tpg = target.tpgs.next() # get the first one
|
||||||
for acl in tpg.node_acls:
|
for acl in tpg.node_acls:
|
||||||
# See if this ACL configuration already exists
|
# See if this ACL configuration already exists
|
||||||
if acl['node_wwn'] == initiator_iqn:
|
if acl.node_wwn == initiator_iqn:
|
||||||
# No further action required
|
# No further action required
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -844,7 +844,7 @@ class TestCinderRtstoolCmd(test.TestCase):
|
||||||
target_iqn = mock.MagicMock()
|
target_iqn = mock.MagicMock()
|
||||||
target_iqn.tpgs.return_value = \
|
target_iqn.tpgs.return_value = \
|
||||||
[{'node_acls': mock.sentinel.initiator_iqn}]
|
[{'node_acls': mock.sentinel.initiator_iqn}]
|
||||||
acl = {'node_wwn': mock.sentinel.initiator_iqn}
|
acl = mock.MagicMock(node_wwn=mock.sentinel.initiator_iqn)
|
||||||
tpg = mock.MagicMock(node_acls=[acl])
|
tpg = mock.MagicMock(node_acls=[acl])
|
||||||
tpgs = mock.MagicMock()
|
tpgs = mock.MagicMock()
|
||||||
tpgs.next.return_value = tpg
|
tpgs.next.return_value = tpg
|
||||||
|
|
Loading…
Reference in New Issue