summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tantsur <divius.inside@gmail.com>2018-05-11 18:06:52 +0200
committerDmitry Tantsur <divius.inside@gmail.com>2018-05-16 11:13:59 +0000
commit0c2c55c504aaf9d793f349b30d9687785c205cf6 (patch)
tree071fe8e78a6b74bd069358761fea1b827a40a7ac
parent38befed4f845a3fbc85ce97fba27bfbc359f7eab (diff)
Remove support for classic drivers
They are deprecated and will be removed from Ironic. A similar change was already done to the containerized undercloud. Change-Id: If442f103adc03ec97f9e995d5e2bc47dfc097f90
Notes
Notes (review): Code-Review+2: Alex Schultz <aschultz@redhat.com> Verified+1: RDO Third Party CI <dmsimard+rdothirdparty@redhat.com> Code-Review+1: Bogdan Dobrelya <bdobreli@redhat.com> Code-Review+2: James Slagle <jslagle@redhat.com> Workflow+1: James Slagle <jslagle@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 30 May 2018 09:38:25 +0000 Reviewed-on: https://review.openstack.org/567886 Project: openstack/instack-undercloud Branch: refs/heads/master
-rw-r--r--elements/puppet-stack-config/puppet-stack-config.yaml.template1
-rw-r--r--instack_undercloud/tests/test_undercloud.py19
-rw-r--r--instack_undercloud/undercloud.py37
-rw-r--r--undercloud.conf.sample16
4 files changed, 10 insertions, 63 deletions
diff --git a/elements/puppet-stack-config/puppet-stack-config.yaml.template b/elements/puppet-stack-config/puppet-stack-config.yaml.template
index 5345862..6e58e37 100644
--- a/elements/puppet-stack-config/puppet-stack-config.yaml.template
+++ b/elements/puppet-stack-config/puppet-stack-config.yaml.template
@@ -518,7 +518,6 @@ ironic::conductor::cleaning_disk_erase: 'metadata'
518ironic::conductor::cleaning_network: 'ctlplane' 518ironic::conductor::cleaning_network: 'ctlplane'
519ironic::conductor::provisioning_network: 'ctlplane' 519ironic::conductor::provisioning_network: 'ctlplane'
520ironic::conductor::default_boot_option: 'local' 520ironic::conductor::default_boot_option: 'local'
521ironic::conductor::enabled_drivers: {{ENABLED_DRIVERS}}
522ironic::conductor::enabled_hardware_types: {{ENABLED_HARDWARE_TYPES}} 521ironic::conductor::enabled_hardware_types: {{ENABLED_HARDWARE_TYPES}}
523ironic::drivers::interfaces::default_inspect_interface: inspector 522ironic::drivers::interfaces::default_inspect_interface: inspector
524ironic::drivers::interfaces::enabled_boot_interfaces: {{ENABLED_BOOT_INTERFACES}} 523ironic::drivers::interfaces::enabled_boot_interfaces: {{ENABLED_BOOT_INTERFACES}}
diff --git a/instack_undercloud/tests/test_undercloud.py b/instack_undercloud/tests/test_undercloud.py
index d4ae4d3..725a4e5 100644
--- a/instack_undercloud/tests/test_undercloud.py
+++ b/instack_undercloud/tests/test_undercloud.py
@@ -506,9 +506,6 @@ class TestGenerateEnvironment(BaseTestCase):
506 self.assertEqual('192.168.24.1', env['LOCAL_IP']) 506 self.assertEqual('192.168.24.1', env['LOCAL_IP'])
507 # The list is generated from a set, so we can't rely on ordering. 507 # The list is generated from a set, so we can't rely on ordering.
508 # Instead make sure that it looks like a valid list by parsing it. 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 hw_types = json.loads(env['ENABLED_HARDWARE_TYPES']) 509 hw_types = json.loads(env['ENABLED_HARDWARE_TYPES'])
513 self.assertEqual(sorted(hw_types), ['idrac', 'ilo', 'ipmi', 'redfish']) 510 self.assertEqual(sorted(hw_types), ['idrac', 'ilo', 'ipmi', 'redfish'])
514 self.assertEqual( 511 self.assertEqual(
@@ -561,28 +558,12 @@ class TestGenerateEnvironment(BaseTestCase):
561 558
562 def test_enabled_discovery(self): 559 def test_enabled_discovery(self):
563 self.conf.config(enable_node_discovery=True, 560 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 self.conf.config(enable_node_discovery=True,
577 discovery_default_driver='foobar', 561 discovery_default_driver='foobar',
578 enabled_hardware_types=['ipmi', 'something']) 562 enabled_hardware_types=['ipmi', 'something'])
579 env = undercloud._generate_environment('.') 563 env = undercloud._generate_environment('.')
580 # The list is generated from a set, so we can't rely on ordering. 564 # The list is generated from a set, so we can't rely on ordering.
581 # Instead make sure that it looks like a valid list by parsing it. 565 # Instead make sure that it looks like a valid list by parsing it.
582 drivers = json.loads(env['ENABLED_DRIVERS'])
583 hw_types = json.loads(env['ENABLED_HARDWARE_TYPES']) 566 hw_types = json.loads(env['ENABLED_HARDWARE_TYPES'])
584 self.assertEqual(sorted(drivers), ['pxe_drac', 'pxe_ilo',
585 'pxe_ipmitool'])
586 self.assertEqual(sorted(hw_types), ['foobar', 'ipmi', 'something']) 567 self.assertEqual(sorted(hw_types), ['foobar', 'ipmi', 'something'])
587 568
588 def test_docker_registry_mirror(self): 569 def test_docker_registry_mirror(self):
diff --git a/instack_undercloud/undercloud.py b/instack_undercloud/undercloud.py
index d0eea13..cb11277 100644
--- a/instack_undercloud/undercloud.py
+++ b/instack_undercloud/undercloud.py
@@ -298,7 +298,7 @@ _opts = [
298 default=False, 298 default=False,
299 help=('Makes ironic-inspector enroll any unknown node that ' 299 help=('Makes ironic-inspector enroll any unknown node that '
300 'PXE-boots introspection ramdisk in Ironic. By default, ' 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 'automatically enabled when this option is set to True).' 302 'automatically enabled when this option is set to True).'
303 ' Set discovery_default_driver to override. ' 303 ' Set discovery_default_driver to override. '
304 'Introspection rules can also be used to specify driver ' 304 'Introspection rules can also be used to specify driver '
@@ -306,10 +306,9 @@ _opts = [
306 ), 306 ),
307 cfg.StrOpt('discovery_default_driver', 307 cfg.StrOpt('discovery_default_driver',
308 default='ipmi', 308 default='ipmi',
309 help=('The default driver or hardware type to use for newly ' 309 help=('The default hardware type to use for newly discovered '
310 'discovered nodes (requires enable_node_discovery set to ' 310 'nodes (requires enable_node_discovery set to True). '
311 'True). It is automatically added to enabled_drivers ' 311 'It is automatically added to enabled_hardware_types.')
312 'or enabled_hardware_types accordingly.')
313 ), 312 ),
314 cfg.BoolOpt('undercloud_debug', 313 cfg.BoolOpt('undercloud_debug',
315 default=True, 314 default=True,
@@ -380,12 +379,6 @@ _opts = [
380 default=False, 379 default=False,
381 help=('Whether to clean overcloud nodes (wipe the hard drive) ' 380 help=('Whether to clean overcloud nodes (wipe the hard drive) '
382 'between deployments and after the introspection.')), 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 cfg.ListOpt('enabled_hardware_types', 382 cfg.ListOpt('enabled_hardware_types',
390 default=['ipmi', 'redfish', 'ilo', 'idrac'], 383 default=['ipmi', 'redfish', 'ilo', 'idrac'],
391 help=('List of enabled bare metal hardware types (next ' 384 help=('List of enabled bare metal hardware types (next '
@@ -1223,30 +1216,13 @@ def _generate_sysctl_settings():
1223 return json.dumps(sysctl_settings) 1216 return json.dumps(sysctl_settings)
1224 1217
1225 1218
1226def _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
1238def _process_drivers_and_hardware_types(instack_env): 1219def _process_drivers_and_hardware_types(instack_env):
1239 """Populate the environment with ironic driver information.""" 1220 """Populate the environment with ironic driver information."""
1240 # Ensure correct rendering of the list and uniqueness of the items 1221 # Ensure correct rendering of the list and uniqueness of the items
1241 enabled_drivers = set(CONF.enabled_drivers)
1242 enabled_hardware_types = set(CONF.enabled_hardware_types) 1222 enabled_hardware_types = set(CONF.enabled_hardware_types)
1243 if CONF.enable_node_discovery: 1223 if CONF.enable_node_discovery:
1244 if _is_classic_driver(CONF.discovery_default_driver): 1224 if CONF.discovery_default_driver not in enabled_hardware_types:
1245 if CONF.discovery_default_driver not in enabled_drivers: 1225 enabled_hardware_types.add(CONF.discovery_default_driver)
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)
1250 instack_env['INSPECTION_NODE_NOT_FOUND_HOOK'] = 'enroll' 1226 instack_env['INSPECTION_NODE_NOT_FOUND_HOOK'] = 'enroll'
1251 else: 1227 else:
1252 instack_env['INSPECTION_NODE_NOT_FOUND_HOOK'] = '' 1228 instack_env['INSPECTION_NODE_NOT_FOUND_HOOK'] = ''
@@ -1279,7 +1255,6 @@ def _process_drivers_and_hardware_types(instack_env):
1279 if hw_type in enabled_hardware_types: 1255 if hw_type in enabled_hardware_types:
1280 vendor_interfaces.add(iface) 1256 vendor_interfaces.add(iface)
1281 1257
1282 instack_env['ENABLED_DRIVERS'] = _make_list(enabled_drivers)
1283 instack_env['ENABLED_HARDWARE_TYPES'] = _make_list(enabled_hardware_types) 1258 instack_env['ENABLED_HARDWARE_TYPES'] = _make_list(enabled_hardware_types)
1284 1259
1285 instack_env['ENABLED_BOOT_INTERFACES'] = _make_list(boot_interfaces) 1260 instack_env['ENABLED_BOOT_INTERFACES'] = _make_list(boot_interfaces)
diff --git a/undercloud.conf.sample b/undercloud.conf.sample
index e549341..8bfc61d 100644
--- a/undercloud.conf.sample
+++ b/undercloud.conf.sample
@@ -141,17 +141,16 @@
141#inspection_runbench = false 141#inspection_runbench = false
142 142
143# Makes ironic-inspector enroll any unknown node that PXE-boots 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# used for new nodes (it is automatically enabled when this option is 145# used for new nodes (it is automatically enabled when this option is
146# set to True). Set discovery_default_driver to override. 146# set to True). Set discovery_default_driver to override.
147# Introspection rules can also be used to specify driver information 147# Introspection rules can also be used to specify driver information
148# for newly enrolled nodes. (boolean value) 148# for newly enrolled nodes. (boolean value)
149#enable_node_discovery = false 149#enable_node_discovery = false
150 150
151# The default driver or hardware type to use for newly discovered 151# The default hardware type to use for newly discovered nodes
152# nodes (requires enable_node_discovery set to True). It is 152# (requires enable_node_discovery set to True). It is automatically
153# automatically added to enabled_drivers or enabled_hardware_types 153# added to enabled_hardware_types. (string value)
154# accordingly. (string value)
155#discovery_default_driver = ipmi 154#discovery_default_driver = ipmi
156 155
157# Whether to enable the debug log level for Undercloud OpenStack 156# Whether to enable the debug log level for Undercloud OpenStack
@@ -211,13 +210,6 @@
211# deployments and after the introspection. (boolean value) 210# deployments and after the introspection. (boolean value)
212#clean_nodes = false 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# List of enabled bare metal hardware types (next generation drivers). 213# List of enabled bare metal hardware types (next generation drivers).
222# (list value) 214# (list value)
223#enabled_hardware_types = ipmi,redfish,ilo,idrac 215#enabled_hardware_types = ipmi,redfish,ilo,idrac