diff --git a/esi_leap/api/controllers/v1/node.py b/esi_leap/api/controllers/v1/node.py index dc296ee8..1dd3e67b 100644 --- a/esi_leap/api/controllers/v1/node.py +++ b/esi_leap/api/controllers/v1/node.py @@ -108,7 +108,7 @@ def get_all(self): provision_state=node.provision_state, resource_class=node.resource_class, properties=ironic.get_condensed_properties( - node.properties, node.traits), + node.properties), maintenance=str(node.maintenance), owner=keystone.get_project_name(node.owner, project_list), lessee=keystone.get_project_name(node.lessee, diff --git a/esi_leap/common/ironic.py b/esi_leap/common/ironic.py index ccdbfcb0..57109f40 100644 --- a/esi_leap/common/ironic.py +++ b/esi_leap/common/ironic.py @@ -55,9 +55,8 @@ def get_node(node_uuid, node_list=None): return node -def get_condensed_properties(properties, traits): +def get_condensed_properties(properties): cp = properties.copy() cp.pop('lease_uuid', None) cp.pop('capabilities', None) - cp['traits'] = traits return cp diff --git a/esi_leap/resource_objects/ironic_node.py b/esi_leap/resource_objects/ironic_node.py index e0e1a2a1..fa8e02ea 100644 --- a/esi_leap/resource_objects/ironic_node.py +++ b/esi_leap/resource_objects/ironic_node.py @@ -66,9 +66,7 @@ def get_properties(self, resource_list=None): 'properties', {}, resource_list=resource_list, err_msg='Error getting resource properties', err_val=error.UNKNOWN['properties']) - traits = self._get_node_attr( - 'traits', [], resource_list=resource_list) - return ironic.get_condensed_properties(properties, traits) + return ironic.get_condensed_properties(properties) def get_owner_project_id(self): return self._get_node_attr('owner', '', diff --git a/esi_leap/tests/api/controllers/v1/test_node.py b/esi_leap/tests/api/controllers/v1/test_node.py index f8781e3b..2596b172 100644 --- a/esi_leap/tests/api/controllers/v1/test_node.py +++ b/esi_leap/tests/api/controllers/v1/test_node.py @@ -21,7 +21,6 @@ def __init__(self): self.owner = 'fake-project-uuid' self.uuid = 'fake-uuid' self.properties = {'lease_uuid': 'fake-lease-uuid', 'cpu': '40'} - self.traits = ['trait1', 'trait2'] self.lessee = 'fake-project-uuid' self.maintenance = False self.provision_state = 'active' @@ -64,4 +63,4 @@ def test_get_all(self, mock_gpl, mock_lga, mock_oga, mock_gnl): self.assertEqual(data['nodes'][0]['lease_uuid'], 'fake-lease-uuid') self.assertEqual(data['nodes'][0]['lessee'], 'fake-project') self.assertEqual(data['nodes'][0]['properties'], { - 'cpu': '40', 'traits': ['trait1', 'trait2']}) + 'cpu': '40'}) diff --git a/esi_leap/tests/common/test_ironic.py b/esi_leap/tests/common/test_ironic.py index bc66c536..07ef5cea 100644 --- a/esi_leap/tests/common/test_ironic.py +++ b/esi_leap/tests/common/test_ironic.py @@ -56,12 +56,10 @@ def test_get_condensed_properties(self): 'cpu': '40', 'local_gb': '1000' } - traits = ['trait1', 'trait2'] cp = ironic.get_condensed_properties( - properties, traits) + properties) self.assertEqual(cp, { 'cpu': '40', - 'local_gb': '1000', - 'traits': ['trait1', 'trait2'] + 'local_gb': '1000' }) diff --git a/esi_leap/tests/resource_objects/test_ironic_node.py b/esi_leap/tests/resource_objects/test_ironic_node.py index fcd6b285..b54a6822 100644 --- a/esi_leap/tests/resource_objects/test_ironic_node.py +++ b/esi_leap/tests/resource_objects/test_ironic_node.py @@ -32,7 +32,6 @@ def __init__(self): self.name = 'fake-node' self.properties = {'lease_uuid': '001', 'cpu': '40'} self.provision_state = 'available' - self.traits = ['trait1', 'trait2'] self.uuid = fake_uuid self.resource_class = 'baremetal' self.power_state = 'off' @@ -94,12 +93,9 @@ def test_get_properties(self, mock_gn): test_ironic_node = ironic_node.IronicNode(fake_uuid) properties = test_ironic_node.get_properties() - expected_properties = { - 'cpu': '40', - 'traits': ['trait1', 'trait2'] - } + expected_properties = {'cpu': '40'} self.assertEqual(properties, expected_properties) - assert mock_gn.call_count == 2 + mock_gn.assert_called_once() @mock.patch('esi_leap.resource_objects.ironic_node.IronicNode._get_node') def test_get_owner_project_id(self, mock_gn):