fix bug in zone-policy
change action.node to action.entity. Change-Id: Ie5bd34fdd25764f4d8cf91b0e98503777a9c60a3
This commit is contained in:
parent
36f49fbf4d
commit
0bd8ba93f1
|
@ -176,7 +176,7 @@ class ZonePlacementPolicy(base.Policy):
|
|||
"""
|
||||
if action.action == consts.NODE_CREATE:
|
||||
# skip the policy if availability zone is specified in profile
|
||||
profile = action.node.rt['profile']
|
||||
profile = action.entity.rt['profile']
|
||||
if profile.properties[profile.AVAILABILITY_ZONE]:
|
||||
return 0
|
||||
return 1
|
||||
|
|
|
@ -133,7 +133,7 @@ class TestZonePlacementPolicy(base.SenlinTestCase):
|
|||
x_profile = mock.Mock(AVAILABILITY_ZONE='availability_zone',
|
||||
properties={'availability_zone': 'zone1'})
|
||||
x_node = mock.Mock(rt={'profile': x_profile})
|
||||
action = mock.Mock(action=consts.NODE_CREATE, node=x_node)
|
||||
action = mock.Mock(action=consts.NODE_CREATE, entity=x_node)
|
||||
|
||||
policy = zp.ZonePlacementPolicy('p1', self.spec)
|
||||
|
||||
|
@ -144,7 +144,7 @@ class TestZonePlacementPolicy(base.SenlinTestCase):
|
|||
x_profile = mock.Mock(AVAILABILITY_ZONE='availability_zone',
|
||||
properties={'availability_zone': None})
|
||||
x_node = mock.Mock(rt={'profile': x_profile})
|
||||
action = mock.Mock(action=consts.NODE_CREATE, node=x_node)
|
||||
action = mock.Mock(action=consts.NODE_CREATE, entity=x_node)
|
||||
|
||||
policy = zp.ZonePlacementPolicy('p1', self.spec)
|
||||
|
||||
|
|
Loading…
Reference in New Issue