Browse Source

Merge "Remove support for classic drivers"

tags/9.1.0
Zuul 1 year ago
parent
commit
ad1b8113e7

+ 0
- 1
elements/puppet-stack-config/puppet-stack-config.yaml.template View File

@@ -518,7 +518,6 @@ ironic::conductor::cleaning_disk_erase: 'metadata'
518 518
 ironic::conductor::cleaning_network: 'ctlplane'
519 519
 ironic::conductor::provisioning_network: 'ctlplane'
520 520
 ironic::conductor::default_boot_option: 'local'
521
-ironic::conductor::enabled_drivers: {{ENABLED_DRIVERS}}
522 521
 ironic::conductor::enabled_hardware_types: {{ENABLED_HARDWARE_TYPES}}
523 522
 ironic::drivers::interfaces::default_inspect_interface: inspector
524 523
 ironic::drivers::interfaces::enabled_boot_interfaces: {{ENABLED_BOOT_INTERFACES}}

+ 0
- 19
instack_undercloud/tests/test_undercloud.py View File

@@ -506,9 +506,6 @@ class TestGenerateEnvironment(BaseTestCase):
506 506
         self.assertEqual('192.168.24.1', env['LOCAL_IP'])
507 507
         # The list is generated from a set, so we can't rely on ordering.
508 508
         # Instead make sure that it looks like a valid list by parsing it.
509
-        drivers = json.loads(env['ENABLED_DRIVERS'])
510
-        self.assertEqual(sorted(drivers), ['pxe_drac', 'pxe_ilo',
511
-                                           'pxe_ipmitool'])
512 509
         hw_types = json.loads(env['ENABLED_HARDWARE_TYPES'])
513 510
         self.assertEqual(sorted(hw_types), ['idrac', 'ilo', 'ipmi', 'redfish'])
514 511
         self.assertEqual(
@@ -560,29 +557,13 @@ class TestGenerateEnvironment(BaseTestCase):
560 557
             ['idrac', 'ipmitool', 'no-vendor'])
561 558
 
562 559
     def test_enabled_discovery(self):
563
-        self.conf.config(enable_node_discovery=True,
564
-                         discovery_default_driver='pxe_foobar')
565
-        env = undercloud._generate_environment('.')
566
-        # The list is generated from a set, so we can't rely on ordering.
567
-        # Instead make sure that it looks like a valid list by parsing it.
568
-        drivers = json.loads(env['ENABLED_DRIVERS'])
569
-        # Discovery requires enabling the default driver. The pxe_ prefix
570
-        # designates a classic driver.
571
-        self.assertEqual(sorted(drivers), ['pxe_drac', 'pxe_foobar', 'pxe_ilo',
572
-                                           'pxe_ipmitool'])
573
-        self.assertEqual(env['INSPECTION_NODE_NOT_FOUND_HOOK'], 'enroll')
574
-
575
-    def test_enabled_hardware_types(self):
576 560
         self.conf.config(enable_node_discovery=True,
577 561
                          discovery_default_driver='foobar',
578 562
                          enabled_hardware_types=['ipmi', 'something'])
579 563
         env = undercloud._generate_environment('.')
580 564
         # The list is generated from a set, so we can't rely on ordering.
581 565
         # Instead make sure that it looks like a valid list by parsing it.
582
-        drivers = json.loads(env['ENABLED_DRIVERS'])
583 566
         hw_types = json.loads(env['ENABLED_HARDWARE_TYPES'])
584
-        self.assertEqual(sorted(drivers), ['pxe_drac', 'pxe_ilo',
585
-                                           'pxe_ipmitool'])
586 567
         self.assertEqual(sorted(hw_types), ['foobar', 'ipmi', 'something'])
587 568
 
588 569
     def test_docker_registry_mirror(self):

+ 6
- 31
instack_undercloud/undercloud.py View File

@@ -298,7 +298,7 @@ _opts = [
298 298
                 default=False,
299 299
                 help=('Makes ironic-inspector enroll any unknown node that '
300 300
                       'PXE-boots introspection ramdisk in Ironic. By default, '
301
-                      'the "fake" driver is used for new nodes (it is '
301
+                      'the "ipmi" driver is used for new nodes (it is '
302 302
                       'automatically enabled when this option is set to True).'
303 303
                       ' Set discovery_default_driver to override. '
304 304
                       'Introspection rules can also be used to specify driver '
@@ -306,10 +306,9 @@ _opts = [
306 306
                 ),
307 307
     cfg.StrOpt('discovery_default_driver',
308 308
                default='ipmi',
309
-               help=('The default driver or hardware type to use for newly '
310
-                     'discovered nodes (requires enable_node_discovery set to '
311
-                     'True). It is automatically added to enabled_drivers '
312
-                     'or enabled_hardware_types accordingly.')
309
+               help=('The default hardware type to use for newly discovered '
310
+                     'nodes (requires enable_node_discovery set to True). '
311
+                     'It is automatically added to enabled_hardware_types.')
313 312
                ),
314 313
     cfg.BoolOpt('undercloud_debug',
315 314
                 default=True,
@@ -380,12 +379,6 @@ _opts = [
380 379
                 default=False,
381 380
                 help=('Whether to clean overcloud nodes (wipe the hard drive) '
382 381
                       'between deployments and after the introspection.')),
383
-    cfg.ListOpt('enabled_drivers',
384
-                default=['pxe_ipmitool', 'pxe_drac', 'pxe_ilo'],
385
-                help=('List of enabled bare metal drivers.'),
386
-                deprecated_for_removal=True,
387
-                deprecated_reason=('Please switch to hardware types and '
388
-                                   'the enabled_hardware_types option.')),
389 382
     cfg.ListOpt('enabled_hardware_types',
390 383
                 default=['ipmi', 'redfish', 'ilo', 'idrac'],
391 384
                 help=('List of enabled bare metal hardware types (next '
@@ -1223,30 +1216,13 @@ def _generate_sysctl_settings():
1223 1216
     return json.dumps(sysctl_settings)
1224 1217
 
1225 1218
 
1226
-def _is_classic_driver(name):
1227
-    """Poor man's way to detect if something is a driver or a hardware type.
1228
-
1229
-    To be removed when we remove support for classic drivers.
1230
-    """
1231
-    return (name == 'fake' or
1232
-            name.startswith('fake_') or
1233
-            name.startswith('pxe_') or
1234
-            name.startswith('agent_') or
1235
-            name.startswith('iscsi_'))
1236
-
1237
-
1238 1219
 def _process_drivers_and_hardware_types(instack_env):
1239 1220
     """Populate the environment with ironic driver information."""
1240 1221
     # Ensure correct rendering of the list and uniqueness of the items
1241
-    enabled_drivers = set(CONF.enabled_drivers)
1242 1222
     enabled_hardware_types = set(CONF.enabled_hardware_types)
1243 1223
     if CONF.enable_node_discovery:
1244
-        if _is_classic_driver(CONF.discovery_default_driver):
1245
-            if CONF.discovery_default_driver not in enabled_drivers:
1246
-                enabled_drivers.add(CONF.discovery_default_driver)
1247
-        else:
1248
-            if CONF.discovery_default_driver not in enabled_hardware_types:
1249
-                enabled_hardware_types.add(CONF.discovery_default_driver)
1224
+        if CONF.discovery_default_driver not in enabled_hardware_types:
1225
+            enabled_hardware_types.add(CONF.discovery_default_driver)
1250 1226
         instack_env['INSPECTION_NODE_NOT_FOUND_HOOK'] = 'enroll'
1251 1227
     else:
1252 1228
         instack_env['INSPECTION_NODE_NOT_FOUND_HOOK'] = ''
@@ -1279,7 +1255,6 @@ def _process_drivers_and_hardware_types(instack_env):
1279 1255
         if hw_type in enabled_hardware_types:
1280 1256
             vendor_interfaces.add(iface)
1281 1257
 
1282
-    instack_env['ENABLED_DRIVERS'] = _make_list(enabled_drivers)
1283 1258
     instack_env['ENABLED_HARDWARE_TYPES'] = _make_list(enabled_hardware_types)
1284 1259
 
1285 1260
     instack_env['ENABLED_BOOT_INTERFACES'] = _make_list(boot_interfaces)

+ 4
- 12
undercloud.conf.sample View File

@@ -141,17 +141,16 @@
141 141
 #inspection_runbench = false
142 142
 
143 143
 # Makes ironic-inspector enroll any unknown node that PXE-boots
144
-# introspection ramdisk in Ironic. By default, the "fake" driver is
144
+# introspection ramdisk in Ironic. By default, the "ipmi" driver is
145 145
 # used for new nodes (it is automatically enabled when this option is
146 146
 # set to True). Set discovery_default_driver to override.
147 147
 # Introspection rules can also be used to specify driver information
148 148
 # for newly enrolled nodes. (boolean value)
149 149
 #enable_node_discovery = false
150 150
 
151
-# The default driver or hardware type to use for newly discovered
152
-# nodes (requires enable_node_discovery set to True). It is
153
-# automatically added to enabled_drivers or enabled_hardware_types
154
-# accordingly. (string value)
151
+# The default hardware type to use for newly discovered nodes
152
+# (requires enable_node_discovery set to True). It is automatically
153
+# added to enabled_hardware_types. (string value)
155 154
 #discovery_default_driver = ipmi
156 155
 
157 156
 # Whether to enable the debug log level for Undercloud OpenStack
@@ -211,13 +210,6 @@
211 210
 # deployments and after the introspection. (boolean value)
212 211
 #clean_nodes = false
213 212
 
214
-# DEPRECATED: List of enabled bare metal drivers. (list value)
215
-# This option is deprecated for removal.
216
-# Its value may be silently ignored in the future.
217
-# Reason: Please switch to hardware types and the
218
-# enabled_hardware_types option.
219
-#enabled_drivers = pxe_ipmitool,pxe_drac,pxe_ilo
220
-
221 213
 # List of enabled bare metal hardware types (next generation drivers).
222 214
 # (list value)
223 215
 #enabled_hardware_types = ipmi,redfish,ilo,idrac

Loading…
Cancel
Save