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
tpg = target.tpgs.next() # get the first one
for acl in tpg.node_acls:
# See if this ACL configuration already exists
- if acl['node_wwn'] == initiator_iqn:
+ if acl.node_wwn == initiator_iqn:
# No further action required
return
target_iqn = mock.MagicMock()
target_iqn.tpgs.return_value = \
[{'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])
tpgs = mock.MagicMock()
tpgs.next.return_value = tpg