diff --git a/tripleo_common/tests/utils/test_plan.py b/tripleo_common/tests/utils/test_plan.py index 3bde3f2bc..8a6a9df9b 100644 --- a/tripleo_common/tests/utils/test_plan.py +++ b/tripleo_common/tests/utils/test_plan.py @@ -741,7 +741,7 @@ class PlanTest(base.TestCase): } mock_resource = mock.MagicMock() mock_resource.attributes = { - 'endpoint_map': {}, + 'endpoint_map': None, 'value': None } mock_orchestration.resources.get.return_value = mock_resource diff --git a/tripleo_common/utils/plan.py b/tripleo_common/utils/plan.py index 9d8e328a9..509a084c4 100644 --- a/tripleo_common/utils/plan.py +++ b/tripleo_common/utils/plan.py @@ -416,16 +416,17 @@ def generate_passwords(swift, heat, mistral=None, except heat_exc.HTTPNotFound: stack_env = None + placement_extracted = False try: # We can't rely on the existence of PlacementPassword to # determine if placement extraction has occured as it was added # in stein while the service extraction was delayed to train. # Inspect the endpoint map instead. endpoint_res = heat.resources.get(container, 'EndpointMap') - endpoints = endpoint_res.attributes.get('endpoint_map', {}) - placement_extracted = 'PlacementPublic' in endpoints + endpoints = endpoint_res.attributes.get('endpoint_map', None) + placement_extracted = endpoints and 'PlacementPublic' in endpoints except heat_exc.HTTPNotFound: - placement_extracted = False + pass passwords = password_utils.generate_passwords( stack_env=stack_env,