@@ -57,7 +57,7 @@ def _get_common_cols_data(self, fake_port):
5757 'network_id' ,
5858 'port_security_enabled' ,
5959 'project_id' ,
60- 'security_groups ' ,
60+ 'security_group_ids ' ,
6161 'status' ,
6262 )
6363
@@ -82,7 +82,7 @@ def _get_common_cols_data(self, fake_port):
8282 fake_port .network_id ,
8383 fake_port .port_security_enabled ,
8484 fake_port .project_id ,
85- utils .format_list (fake_port .security_groups ),
85+ utils .format_list (fake_port .security_group_ids ),
8686 fake_port .status ,
8787 )
8888
@@ -251,7 +251,7 @@ def test_create_with_security_group(self):
251251 verifylist = [
252252 ('network' , self ._port .network_id ,),
253253 ('enable' , True ),
254- ('security_groups ' , [secgroup .id ]),
254+ ('security_group ' , [secgroup .id ]),
255255 ('name' , 'test-port' ),
256256 ]
257257 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
@@ -261,7 +261,7 @@ def test_create_with_security_group(self):
261261 self .network .create_port .assert_called_once_with (** {
262262 'admin_state_up' : True ,
263263 'network_id' : self ._port .network_id ,
264- 'security_groups ' : [secgroup .id ],
264+ 'security_group_ids ' : [secgroup .id ],
265265 'name' : 'test-port' ,
266266 })
267267
@@ -309,7 +309,7 @@ def test_create_with_security_groups(self):
309309 verifylist = [
310310 ('network' , self ._port .network_id ,),
311311 ('enable' , True ),
312- ('security_groups ' , [sg_1 .id , sg_2 .id ]),
312+ ('security_group ' , [sg_1 .id , sg_2 .id ]),
313313 ('name' , 'test-port' ),
314314 ]
315315 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
@@ -319,7 +319,7 @@ def test_create_with_security_groups(self):
319319 self .network .create_port .assert_called_once_with (** {
320320 'admin_state_up' : True ,
321321 'network_id' : self ._port .network_id ,
322- 'security_groups ' : [sg_1 .id , sg_2 .id ],
322+ 'security_group_ids ' : [sg_1 .id , sg_2 .id ],
323323 'name' : 'test-port' ,
324324 })
325325
@@ -346,7 +346,7 @@ def test_create_with_no_security_groups(self):
346346 self .network .create_port .assert_called_once_with (** {
347347 'admin_state_up' : True ,
348348 'network_id' : self ._port .network_id ,
349- 'security_groups ' : [],
349+ 'security_group_ids ' : [],
350350 'name' : 'test-port' ,
351351 })
352352
@@ -590,7 +590,7 @@ class TestListPort(TestPort):
590590 prt .mac_address ,
591591 utils .format_list_of_dicts (prt .fixed_ips ),
592592 prt .status ,
593- utils .format_list (prt .security_groups ),
593+ utils .format_list (prt .security_group_ids ),
594594 prt .device_owner ,
595595 ))
596596
@@ -1111,15 +1111,15 @@ def test_set_security_group(self):
11111111 self ._port .name ,
11121112 ]
11131113 verifylist = [
1114- ('security_groups ' , [sg .id ]),
1114+ ('security_group ' , [sg .id ]),
11151115 ('port' , self ._port .name ),
11161116 ]
11171117
11181118 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
11191119 result = self .cmd .take_action (parsed_args )
11201120
11211121 attrs = {
1122- 'security_groups ' : [sg .id ],
1122+ 'security_group_ids ' : [sg .id ],
11231123 }
11241124 self .network .update_port .assert_called_once_with (self ._port , ** attrs )
11251125 self .assertIsNone (result )
@@ -1130,21 +1130,21 @@ def test_append_security_group(self):
11301130 sg_3 = network_fakes .FakeSecurityGroup .create_one_security_group ()
11311131 self .network .find_security_group = mock .Mock (side_effect = [sg_2 , sg_3 ])
11321132 _testport = network_fakes .FakePort .create_one_port (
1133- {'security_groups ' : [sg_1 .id ]})
1133+ {'security_group_ids ' : [sg_1 .id ]})
11341134 self .network .find_port = mock .Mock (return_value = _testport )
11351135 arglist = [
11361136 '--security-group' , sg_2 .id ,
11371137 '--security-group' , sg_3 .id ,
11381138 _testport .name ,
11391139 ]
11401140 verifylist = [
1141- ('security_groups ' , [sg_2 .id , sg_3 .id ]),
1141+ ('security_group ' , [sg_2 .id , sg_3 .id ]),
11421142 ('port' , _testport .name ),
11431143 ]
11441144 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
11451145 result = self .cmd .take_action (parsed_args )
11461146 attrs = {
1147- 'security_groups ' : [sg_1 .id , sg_2 .id , sg_3 .id ],
1147+ 'security_group_ids ' : [sg_2 .id , sg_3 .id , sg_1 .id ],
11481148 }
11491149 self .network .update_port .assert_called_once_with (_testport , ** attrs )
11501150 self .assertIsNone (result )
@@ -1163,7 +1163,7 @@ def test_set_no_security_groups(self):
11631163 result = self .cmd .take_action (parsed_args )
11641164
11651165 attrs = {
1166- 'security_groups ' : [],
1166+ 'security_group_ids ' : [],
11671167 }
11681168 self .network .update_port .assert_called_once_with (self ._port , ** attrs )
11691169 self .assertIsNone (result )
@@ -1172,7 +1172,7 @@ def test_overwrite_security_group(self):
11721172 sg1 = network_fakes .FakeSecurityGroup .create_one_security_group ()
11731173 sg2 = network_fakes .FakeSecurityGroup .create_one_security_group ()
11741174 _testport = network_fakes .FakePort .create_one_port (
1175- {'security_groups ' : [sg1 .id ]})
1175+ {'security_group_ids ' : [sg1 .id ]})
11761176 self .network .find_port = mock .Mock (return_value = _testport )
11771177 self .network .find_security_group = mock .Mock (return_value = sg2 )
11781178 arglist = [
@@ -1181,13 +1181,13 @@ def test_overwrite_security_group(self):
11811181 _testport .name ,
11821182 ]
11831183 verifylist = [
1184- ('security_groups ' , [sg2 .id ]),
1184+ ('security_group ' , [sg2 .id ]),
11851185 ('no_security_group' , True )
11861186 ]
11871187 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
11881188 result = self .cmd .take_action (parsed_args )
11891189 attrs = {
1190- 'security_groups ' : [sg2 .id ],
1190+ 'security_group_ids ' : [sg2 .id ],
11911191 }
11921192 self .network .update_port .assert_called_once_with (_testport , ** attrs )
11931193 self .assertIsNone (result )
@@ -1434,22 +1434,22 @@ def test_unset_security_group(self):
14341434 _fake_sg1 = network_fakes .FakeSecurityGroup .create_one_security_group ()
14351435 _fake_sg2 = network_fakes .FakeSecurityGroup .create_one_security_group ()
14361436 _fake_port = network_fakes .FakePort .create_one_port (
1437- {'security_groups ' : [_fake_sg1 .id , _fake_sg2 .id ]})
1437+ {'security_group_ids ' : [_fake_sg1 .id , _fake_sg2 .id ]})
14381438 self .network .find_port = mock .Mock (return_value = _fake_port )
14391439 self .network .find_security_group = mock .Mock (return_value = _fake_sg2 )
14401440 arglist = [
14411441 '--security-group' , _fake_sg2 .id ,
14421442 _fake_port .name ,
14431443 ]
14441444 verifylist = [
1445- ('security_groups ' , [_fake_sg2 .id ]),
1445+ ('security_group_ids ' , [_fake_sg2 .id ]),
14461446 ]
14471447
14481448 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
14491449 result = self .cmd .take_action (parsed_args )
14501450
14511451 attrs = {
1452- 'security_groups ' : [_fake_sg1 .id ]
1452+ 'security_group_ids ' : [_fake_sg1 .id ]
14531453 }
14541454 self .network .update_port .assert_called_once_with (
14551455 _fake_port , ** attrs )
@@ -1459,14 +1459,14 @@ def test_unset_port_security_group_not_existent(self):
14591459 _fake_sg1 = network_fakes .FakeSecurityGroup .create_one_security_group ()
14601460 _fake_sg2 = network_fakes .FakeSecurityGroup .create_one_security_group ()
14611461 _fake_port = network_fakes .FakePort .create_one_port (
1462- {'security_groups ' : [_fake_sg1 .id ]})
1462+ {'security_group_ids ' : [_fake_sg1 .id ]})
14631463 self .network .find_security_group = mock .Mock (return_value = _fake_sg2 )
14641464 arglist = [
14651465 '--security-group' , _fake_sg2 .id ,
14661466 _fake_port .name ,
14671467 ]
14681468 verifylist = [
1469- ('security_groups ' , [_fake_sg2 .id ]),
1469+ ('security_group_ids ' , [_fake_sg2 .id ]),
14701470 ]
14711471
14721472 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
0 commit comments