@@ -4524,7 +4524,7 @@ def test_server_migrate_no_options(self):
45244524 ]
45254525 verifylist = [
45264526 ('live' , None ),
4527- ('block_migration' , False ),
4527+ ('block_migration' , None ),
45284528 ('disk_overcommit' , False ),
45294529 ('wait' , False ),
45304530 ]
@@ -4547,7 +4547,7 @@ def test_server_migrate_with_host_2_56(self):
45474547 ('live' , None ),
45484548 ('live_migration' , False ),
45494549 ('host' , 'fakehost' ),
4550- ('block_migration' , False ),
4550+ ('block_migration' , None ),
45514551 ('disk_overcommit' , False ),
45524552 ('wait' , False ),
45534553 ]
@@ -4588,7 +4588,7 @@ def test_server_migrate_with_disk_overcommit(self):
45884588 ]
45894589 verifylist = [
45904590 ('live' , None ),
4591- ('block_migration' , False ),
4591+ ('block_migration' , None ),
45924592 ('disk_overcommit' , True ),
45934593 ('wait' , False ),
45944594 ]
@@ -4611,7 +4611,7 @@ def test_server_migrate_with_host_pre_2_56(self):
46114611 ('live' , None ),
46124612 ('live_migration' , False ),
46134613 ('host' , 'fakehost' ),
4614- ('block_migration' , False ),
4614+ ('block_migration' , None ),
46154615 ('disk_overcommit' , False ),
46164616 ('wait' , False ),
46174617 ]
@@ -4637,7 +4637,7 @@ def test_server_live_migrate(self):
46374637 ('live' , 'fakehost' ),
46384638 ('live_migration' , False ),
46394639 ('host' , None ),
4640- ('block_migration' , False ),
4640+ ('block_migration' , None ),
46414641 ('disk_overcommit' , False ),
46424642 ('wait' , False ),
46434643 ]
@@ -4670,7 +4670,7 @@ def test_server_live_migrate_host_pre_2_30(self):
46704670 ('live' , None ),
46714671 ('live_migration' , True ),
46724672 ('host' , 'fakehost' ),
4673- ('block_migration' , False ),
4673+ ('block_migration' , None ),
46744674 ('disk_overcommit' , False ),
46754675 ('wait' , False ),
46764676 ]
@@ -4696,7 +4696,7 @@ def test_server_live_migrate_no_host(self):
46964696 ('live' , None ),
46974697 ('live_migration' , True ),
46984698 ('host' , None ),
4699- ('block_migration' , False ),
4699+ ('block_migration' , None ),
47004700 ('disk_overcommit' , False ),
47014701 ('wait' , False ),
47024702 ]
@@ -4724,7 +4724,7 @@ def test_server_live_migrate_with_host(self):
47244724 ('live' , None ),
47254725 ('live_migration' , True ),
47264726 ('host' , 'fakehost' ),
4727- ('block_migration' , False ),
4727+ ('block_migration' , None ),
47284728 ('disk_overcommit' , False ),
47294729 ('wait' , False ),
47304730 ]
@@ -4736,9 +4736,10 @@ def test_server_live_migrate_with_host(self):
47364736 result = self .cmd .take_action (parsed_args )
47374737
47384738 self .servers_mock .get .assert_called_with (self .server .id )
4739- # No disk_overcommit with microversion >= 2.25.
4740- self .server .live_migrate .assert_called_with (block_migration = False ,
4741- host = 'fakehost' )
4739+ # No disk_overcommit and block_migration defaults to auto with
4740+ # microversion >= 2.25
4741+ self .server .live_migrate .assert_called_with (
4742+ block_migration = 'auto' , host = 'fakehost' )
47424743 self .assertNotCalled (self .servers_mock .migrate )
47434744 self .assertIsNone (result )
47444745
@@ -4753,7 +4754,7 @@ def test_server_live_migrate_without_host_override_live(self):
47534754 ('live' , 'fakehost' ),
47544755 ('live_migration' , True ),
47554756 ('host' , None ),
4756- ('block_migration' , False ),
4757+ ('block_migration' , None ),
47574758 ('disk_overcommit' , False ),
47584759 ('wait' , False ),
47594760 ]
@@ -4779,8 +4780,9 @@ def test_server_live_migrate_live_and_host_mutex(self):
47794780 arglist = [
47804781 '--live' , 'fakehost' , '--host' , 'fakehost' , self .server .id ,
47814782 ]
4782- self .assertRaises (utils .ParserException ,
4783- self .check_parser , self .cmd , arglist , verify_args = [])
4783+ self .assertRaises (
4784+ utils .ParserException ,
4785+ self .check_parser , self .cmd , arglist , verify_args = [])
47844786
47854787 def test_server_block_live_migrate (self ):
47864788 arglist = [
@@ -4812,7 +4814,7 @@ def test_server_live_migrate_with_disk_overcommit(self):
48124814 ]
48134815 verifylist = [
48144816 ('live' , 'fakehost' ),
4815- ('block_migration' , False ),
4817+ ('block_migration' , None ),
48164818 ('disk_overcommit' , True ),
48174819 ('wait' , False ),
48184820 ]
@@ -4861,7 +4863,7 @@ def test_server_live_migrate_225(self):
48614863 ]
48624864 verifylist = [
48634865 ('live' , 'fakehost' ),
4864- ('block_migration' , False ),
4866+ ('block_migration' , None ),
48654867 ('wait' , False ),
48664868 ]
48674869 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
@@ -4872,8 +4874,11 @@ def test_server_live_migrate_225(self):
48724874 result = self .cmd .take_action (parsed_args )
48734875
48744876 self .servers_mock .get .assert_called_with (self .server .id )
4875- self .server .live_migrate .assert_called_with (block_migration = False ,
4876- host = 'fakehost' )
4877+ # No disk_overcommit and block_migration defaults to auto with
4878+ # microversion >= 2.25
4879+ self .server .live_migrate .assert_called_with (
4880+ block_migration = 'auto' ,
4881+ host = 'fakehost' )
48774882 self .assertNotCalled (self .servers_mock .migrate )
48784883 self .assertIsNone (result )
48794884
@@ -4884,7 +4889,7 @@ def test_server_migrate_with_wait(self, mock_wait_for_status):
48844889 ]
48854890 verifylist = [
48864891 ('live' , None ),
4887- ('block_migration' , False ),
4892+ ('block_migration' , None ),
48884893 ('disk_overcommit' , False ),
48894894 ('wait' , True ),
48904895 ]
@@ -4904,7 +4909,7 @@ def test_server_migrate_with_wait_fails(self, mock_wait_for_status):
49044909 ]
49054910 verifylist = [
49064911 ('live' , None ),
4907- ('block_migration' , False ),
4912+ ('block_migration' , None ),
49084913 ('disk_overcommit' , False ),
49094914 ('wait' , True ),
49104915 ]
0 commit comments