Merge "Don't migrate away from iscsi if it is the default"

This commit is contained in:
Zuul 2020-09-30 18:20:52 +00:00 committed by Gerrit Code Review
commit 35281912c3
2 changed files with 14 additions and 0 deletions

View File

@ -1546,6 +1546,12 @@ class Connection(api.Connection):
'force=true to override.')
return 0, 0
if CONF.default_deploy_interface == 'iscsi':
LOG.warning('The iscsi deploy interface is the default, will '
'not migrate nodes away from it. Run with '
'--option force=true to override.')
return 0, 0
if CONF.agent.image_download_source == 'swift':
LOG.warning('The direct deploy interface is using swift, will '
'not migrate nodes to it. Run with --option '

View File

@ -290,6 +290,14 @@ class MigrateFromIscsiTestCase(base.DbTestCase):
self.assertEqual(
(0, 0), self.dbapi.migrate_from_iscsi_deploy(self.context, 0))
def test_migration_impossible3(self):
self.config(default_deploy_interface='iscsi')
for _i in range(3):
uuid = uuidutils.generate_uuid()
utils.create_test_node(uuid=uuid, deploy_interface='iscsi')
self.assertEqual(
(0, 0), self.dbapi.migrate_from_iscsi_deploy(self.context, 0))
def test_force_migration(self):
self.config(enabled_deploy_interfaces='iscsi')
utils.create_test_node(deploy_interface='direct')