Skip to content

Commit bc13164

Browse files
Remove baremetal allocations microversion check (#17791)
* Remove baremetal allocations microversion check * Remove test_allocations_low_microversion * Added changelog * Added changelog * Remove 'removed' changelog * Remove microversion check for allocations in sdk api * Remove no longer needed REST_IRONIC_MICROVERSION_1_10 * Remove no longer needed SDK_IRONIC_MICROVERSION_1_10
1 parent 2552879 commit bc13164

File tree

5 files changed

+1
-51
lines changed

5 files changed

+1
-51
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove baremetal allocations microversion check

openstack_controller/datadog_checks/openstack_controller/api/api_rest.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,6 @@ def get_baremetal_drivers(self):
473473
return response.json().get('drivers', [])
474474

475475
def get_baremetal_allocations(self):
476-
if float(self.config.ironic_microversion) < 1.52:
477-
self.log.info(
478-
"Ironic microversion is below 1.52 and set to %s, cannot collect allocations",
479-
self.config.ironic_microversion,
480-
)
481-
return []
482476
return self.make_paginated_request(
483477
'{}/v1/allocations'.format(self._catalog.get_endpoint_by_type(Component.Types.BAREMETAL.value)),
484478
'allocations',

openstack_controller/datadog_checks/openstack_controller/api/api_sdk.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,6 @@ def get_baremetal_drivers(self):
298298
return [driver.to_dict(original_names=True) for driver in self.connection.baremetal.drivers()]
299299

300300
def get_baremetal_allocations(self):
301-
if float(self.config.ironic_microversion) < 1.52:
302-
self.log.info(
303-
"Ironic microversion is below 1.52 and set to %s, cannot collect allocations",
304-
self.config.ironic_microversion,
305-
)
306-
return []
307301
return [
308302
allocation.to_dict(original_names=True)
309303
for allocation in self.call_paginated_api(

openstack_controller/tests/configs.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,6 @@
237237
'use_legacy_check_version': False,
238238
}
239239

240-
REST_IRONIC_MICROVERSION_1_10 = {
241-
'keystone_server_url': 'http://127.0.0.1:8080/identity',
242-
'username': 'admin',
243-
'password': 'password',
244-
'ironic_microversion': '1.10',
245-
'use_legacy_check_version': False,
246-
}
247-
248240
REST_MICROVERSION_3_70 = {
249241
'keystone_server_url': 'http://127.0.0.1:8080/identity',
250242
'username': 'admin',
@@ -468,13 +460,6 @@
468460
'use_legacy_check_version': False,
469461
}
470462

471-
SDK_IRONIC_MICROVERSION_1_10 = {
472-
'openstack_cloud_name': 'test_cloud',
473-
'openstack_config_file_path': TEST_OPENSTACK_CONFIG_UNIT_TESTS_PATH,
474-
'ironic_microversion': '1.10',
475-
'use_legacy_check_version': False,
476-
}
477-
478463
SDK_MICROVERSION_3_70 = {
479464
'openstack_cloud_name': 'test_cloud',
480465
'openstack_config_file_path': TEST_OPENSTACK_CONFIG_UNIT_TESTS_PATH,

openstack_controller/tests/test_unit_ironic.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -507,30 +507,6 @@ def test_allocations_metrics(aggregator, check, dd_run_check, metrics):
507507
)
508508

509509

510-
@pytest.mark.parametrize(
511-
('instance'),
512-
[
513-
pytest.param(
514-
configs.REST_IRONIC_MICROVERSION_1_10,
515-
id='api rest microversion default',
516-
),
517-
pytest.param(
518-
configs.SDK_IRONIC_MICROVERSION_1_10,
519-
id='api sdk microversion default',
520-
),
521-
],
522-
)
523-
@pytest.mark.usefixtures('mock_http_get', 'mock_http_post', 'openstack_connection')
524-
def test_allocations_low_microversion(aggregator, check, dd_run_check, caplog):
525-
caplog.set_level(logging.INFO)
526-
dd_run_check(check)
527-
assert 'Ironic microversion is below 1.52 and set to 1.10, cannot collect allocations' in caplog.text
528-
aggregator.assert_metric(
529-
'openstack.ironic.allocation.count',
530-
count=0,
531-
)
532-
533-
534510
@pytest.mark.parametrize(
535511
('connection_baremetal', 'instance', 'paginated_limit', 'api_type', 'expected_api_calls'),
536512
[

0 commit comments

Comments
 (0)