Skip to content

Commit 38e61a2

Browse files
author
Fernando Ojeda
committed
Refactor vlan edit functionality.
1 parent b5a8dd0 commit 38e61a2

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

SoftLayer/CLI/vlan/edit.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@
2222
def cli(env, identifier, name, note, tags):
2323
"""Edit a vlan's details."""
2424

25-
data = {
26-
'name': name,
27-
'note': note
28-
}
25+
new_tags = None
2926

3027
if tags:
31-
data['tags'] = ','.join(tags)
28+
new_tags = ','.join(tags)
3229

3330
mgr = SoftLayer.NetworkManager(env.client)
3431
vlan_id = helpers.resolve_id(mgr.resolve_vlan_ids, identifier, 'VLAN')
35-
vlan = mgr.edit(vlan_id, **data)
32+
vlan = mgr.edit(vlan_id, name=name, note=note, tags=new_tags)
3633

3734
if vlan:
3835
click.secho("Vlan edited successfully", fg='green')

SoftLayer/managers/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def edit(self, instance_id, name=None, note=None, tags=None):
698698
699699
:param integer instance_id: the instance ID to edit.
700700
:param string name: valid name.
701-
:param string note: note about this particular v;am.
701+
:param string note: note about this particular vlan.
702702
:param string tags: tags to set on the vlan as a comma separated list.
703703
Use the empty string to remove all tags.
704704
:returns: bool -- True or an Exception

0 commit comments

Comments
 (0)