Skip to content

Commit fde0cf6

Browse files
author
Fernando Ojeda
committed
Add method docstring.
1 parent 9a0f48a commit fde0cf6

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

SoftLayer/managers/vs.py

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

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

538541
if public_security_groups:
539542
secgroups = [{'securityGroup': {'id': int(sg)}}
@@ -576,7 +579,16 @@ def _generate_create_dict(
576579

577580
return data
578581

579-
def get_network_components(self, data, kwargs, private_subnet, private_vlan, public_subnet, public_vlan):
582+
def get_network_components(self, kwargs, private_subnet, private_vlan, public_subnet, public_vlan):
583+
"""Get the network components structure.
584+
585+
:param kwargs: Vs item list.
586+
:param int private_subnet: Private subnet id.
587+
:param int private_vlan: Private vlan id.
588+
:param int public_subnet: Public subnet id.
589+
:param int public_vlan: Public vlan id.
590+
"""
591+
network_components = None
580592
if kwargs.get('private_router') or kwargs.get('public_router'):
581593
if private_vlan or public_vlan or private_subnet or public_subnet:
582594
raise exceptions.SoftLayerError("You have to select network vlan or network vlan with a subnet or "
@@ -585,11 +597,12 @@ def get_network_components(self, data, kwargs, private_subnet, private_vlan, pub
585597
private_subnet, public_subnet,
586598
kwargs.get('private_router'),
587599
kwargs.get('public_router'))
588-
data.update(network_components)
600+
589601
if private_vlan or public_vlan or private_subnet or public_subnet:
590602
network_components = self._create_network_components(public_vlan, private_vlan,
591603
private_subnet, public_subnet)
592-
data.update(network_components)
604+
605+
return network_components
593606

594607
def _create_network_components(
595608
self, public_vlan=None, private_vlan=None,

0 commit comments

Comments
 (0)