Skip to content

Commit 6d354ce

Browse files
author
Fernando Ojeda
committed
Fix tox test issues.
1 parent fde0cf6 commit 6d354ce

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

SoftLayer/managers/vs.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,7 @@ def _generate_create_dict(
533533
if datacenter:
534534
data["datacenter"] = {"name": datacenter}
535535

536-
network_components = self.get_network_components(kwargs, private_subnet, private_vlan, public_subnet,
537-
public_vlan)
538-
539-
data.update(network_components)
536+
self.get_network_components(data, kwargs, private_subnet, private_vlan, public_subnet, public_vlan)
540537

541538
if public_security_groups:
542539
secgroups = [{'securityGroup': {'id': int(sg)}}
@@ -579,16 +576,16 @@ def _generate_create_dict(
579576

580577
return data
581578

582-
def get_network_components(self, kwargs, private_subnet, private_vlan, public_subnet, public_vlan):
579+
def get_network_components(self, data, kwargs, private_subnet, private_vlan, public_subnet, public_vlan):
583580
"""Get the network components structure.
584581
582+
:param data: Array variable to add the network structure.
585583
:param kwargs: Vs item list.
586584
:param int private_subnet: Private subnet id.
587585
:param int private_vlan: Private vlan id.
588586
:param int public_subnet: Public subnet id.
589587
:param int public_vlan: Public vlan id.
590588
"""
591-
network_components = None
592589
if kwargs.get('private_router') or kwargs.get('public_router'):
593590
if private_vlan or public_vlan or private_subnet or public_subnet:
594591
raise exceptions.SoftLayerError("You have to select network vlan or network vlan with a subnet or "
@@ -597,12 +594,11 @@ def get_network_components(self, kwargs, private_subnet, private_vlan, public_su
597594
private_subnet, public_subnet,
598595
kwargs.get('private_router'),
599596
kwargs.get('public_router'))
600-
597+
data.update(network_components)
601598
if private_vlan or public_vlan or private_subnet or public_subnet:
602599
network_components = self._create_network_components(public_vlan, private_vlan,
603600
private_subnet, public_subnet)
604-
605-
return network_components
601+
data.update(network_components)
606602

607603
def _create_network_components(
608604
self, public_vlan=None, private_vlan=None,

0 commit comments

Comments
 (0)