Merge "Fix placement endpoint check when endpoints are not set" into stable/victoria
This commit is contained in:
commit
03827d9d18
|
@ -741,7 +741,7 @@ class PlanTest(base.TestCase):
|
||||||
}
|
}
|
||||||
mock_resource = mock.MagicMock()
|
mock_resource = mock.MagicMock()
|
||||||
mock_resource.attributes = {
|
mock_resource.attributes = {
|
||||||
'endpoint_map': {},
|
'endpoint_map': None,
|
||||||
'value': None
|
'value': None
|
||||||
}
|
}
|
||||||
mock_orchestration.resources.get.return_value = mock_resource
|
mock_orchestration.resources.get.return_value = mock_resource
|
||||||
|
|
|
@ -418,16 +418,17 @@ def generate_passwords(swift, heat, mistral=None,
|
||||||
except heat_exc.HTTPNotFound:
|
except heat_exc.HTTPNotFound:
|
||||||
stack_env = None
|
stack_env = None
|
||||||
|
|
||||||
|
placement_extracted = False
|
||||||
try:
|
try:
|
||||||
# We can't rely on the existence of PlacementPassword to
|
# We can't rely on the existence of PlacementPassword to
|
||||||
# determine if placement extraction has occured as it was added
|
# determine if placement extraction has occured as it was added
|
||||||
# in stein while the service extraction was delayed to train.
|
# in stein while the service extraction was delayed to train.
|
||||||
# Inspect the endpoint map instead.
|
# Inspect the endpoint map instead.
|
||||||
endpoint_res = heat.resources.get(container, 'EndpointMap')
|
endpoint_res = heat.resources.get(container, 'EndpointMap')
|
||||||
endpoints = endpoint_res.attributes.get('endpoint_map', {})
|
endpoints = endpoint_res.attributes.get('endpoint_map', None)
|
||||||
placement_extracted = 'PlacementPublic' in endpoints
|
placement_extracted = endpoints and 'PlacementPublic' in endpoints
|
||||||
except heat_exc.HTTPNotFound:
|
except heat_exc.HTTPNotFound:
|
||||||
placement_extracted = False
|
pass
|
||||||
|
|
||||||
passwords = password_utils.generate_passwords(
|
passwords = password_utils.generate_passwords(
|
||||||
stack_env=stack_env,
|
stack_env=stack_env,
|
||||||
|
|
Loading…
Reference in New Issue