@@ -126,6 +126,7 @@ def test_network_list(self):
126126 cmd_output = json .loads (self .openstack (
127127 'network create -f json ' +
128128 '--description aaaa ' +
129+ '--no-default ' +
129130 name1
130131 ))
131132 self .addCleanup (self .openstack , 'network delete ' + name1 )
@@ -147,17 +148,11 @@ def test_network_list(self):
147148 'Internal' ,
148149 cmd_output ["router:external" ],
149150 )
150- # NOTE(dtroyer): is_default is not present in the create output
151- # so make sure it stays that way.
152- # NOTE(stevemar): is_default *is* present in SDK 0.9.11 and newer,
153- # but the value seems to always be None, regardless
154- # of the --default or --no-default value.
155- # self.assertEqual('x', cmd_output)
156- if ('is_default' in cmd_output ):
157- self .assertEqual (
158- None ,
159- cmd_output ["is_default" ],
160- )
151+
152+ self .assertEqual (
153+ False ,
154+ cmd_output ["is_default" ],
155+ )
161156 self .assertEqual (
162157 True ,
163158 cmd_output ["port_security_enabled" ],
@@ -185,11 +180,10 @@ def test_network_list(self):
185180 True ,
186181 cmd_output ["shared" ],
187182 )
188- if ('is_default' in cmd_output ):
189- self .assertEqual (
190- None ,
191- cmd_output ["is_default" ],
192- )
183+ self .assertEqual (
184+ None ,
185+ cmd_output ["is_default" ],
186+ )
193187 self .assertEqual (
194188 True ,
195189 cmd_output ["port_security_enabled" ],
@@ -275,16 +269,11 @@ def test_network_set(self):
275269 'Internal' ,
276270 cmd_output ["router:external" ],
277271 )
278- # NOTE(dtroyer): is_default is not present in the create output
279- # so make sure it stays that way.
280- # NOTE(stevemar): is_default *is* present in SDK 0.9.11 and newer,
281- # but the value seems to always be None, regardless
282- # of the --default or --no-default value.
283- if ('is_default' in cmd_output ):
284- self .assertEqual (
285- None ,
286- cmd_output ["is_default" ],
287- )
272+
273+ self .assertEqual (
274+ False ,
275+ cmd_output ["is_default" ],
276+ )
288277 self .assertEqual (
289278 True ,
290279 cmd_output ["port_security_enabled" ],
@@ -321,7 +310,6 @@ def test_network_set(self):
321310 'External' ,
322311 cmd_output ["router:external" ],
323312 )
324- # why not 'None' like above??
325313 self .assertEqual (
326314 False ,
327315 cmd_output ["is_default" ],
@@ -330,29 +318,3 @@ def test_network_set(self):
330318 False ,
331319 cmd_output ["port_security_enabled" ],
332320 )
333-
334- # NOTE(dtroyer): There is ambiguity around is_default in that
335- # it is not in the API docs and apparently can
336- # not be set when the network is --external,
337- # although the option handling code only looks at
338- # the value of is_default when external is True.
339- raw_output = self .openstack (
340- 'network set ' +
341- '--default ' +
342- name
343- )
344- self .assertOutput ('' , raw_output )
345-
346- cmd_output = json .loads (self .openstack (
347- 'network show -f json ' + name
348- ))
349-
350- self .assertEqual (
351- 'cccc' ,
352- cmd_output ["description" ],
353- )
354- # NOTE(dtroyer): This should be 'True'
355- self .assertEqual (
356- False ,
357- cmd_output ["port_security_enabled" ],
358- )
0 commit comments