diff --git a/esi_leap/objects/lease.py b/esi_leap/objects/lease.py index f520e29d..e62176cd 100644 --- a/esi_leap/objects/lease.py +++ b/esi_leap/objects/lease.py @@ -100,7 +100,9 @@ def __init__(self, lease, node): setattr(node, 'node_name', node.get_name()) setattr(node, 'node_provision_state', node.get_node_provision_state()) setattr(node, 'node_power_state', node.get_node_power_state()) - setattr(node, 'node_properties', node.get_config()) + node_config = node.get_config().copy() + node_config.pop('lease_uuid', None) + setattr(node, 'node_properties', node_config) self.populate_schema(lease=lease, node=node) diff --git a/esi_leap/resource_objects/ironic_node.py b/esi_leap/resource_objects/ironic_node.py index 9f575d3e..b7a35ebf 100644 --- a/esi_leap/resource_objects/ironic_node.py +++ b/esi_leap/resource_objects/ironic_node.py @@ -65,7 +65,6 @@ def get_config(self): config = self._get_node_attr('properties', {}, err_msg='Error getting resource config', err_val=error.UNKNOWN['config']) - config.pop('lease_uuid', None) return config def get_owner_project_id(self): diff --git a/esi_leap/tests/resource_objects/test_ironic_node.py b/esi_leap/tests/resource_objects/test_ironic_node.py index a70752cd..6d8e2054 100644 --- a/esi_leap/tests/resource_objects/test_ironic_node.py +++ b/esi_leap/tests/resource_objects/test_ironic_node.py @@ -94,7 +94,6 @@ def test_get_config(self, mock_gn): config = test_ironic_node.get_config() expected_config = fake_get_node.properties - expected_config.pop('lease_uuid', None) self.assertEqual(config, expected_config) mock_gn.assert_called_once()