Skip to content

Commit

Permalink
Merge pull request #145 from tzumainn/lease-expire-fix
Browse files Browse the repository at this point in the history
Fix bug that causes expired leases to not be reflected on ironic nodes
  • Loading branch information
tzumainn authored Jul 13, 2023
2 parents 21490a8 + b7a3772 commit c917d04
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion esi_leap/objects/lease.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion esi_leap/resource_objects/ironic_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion esi_leap/tests/resource_objects/test_ironic_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit c917d04

Please sign in to comment.