Skip to content

Commit b34a7e0

Browse files
caberoscaberos
authored andcommitted
add a some improves
1 parent 9814d06 commit b34a7e0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

SoftLayer/CLI/subnet/route.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import SoftLayer
77
from SoftLayer.CLI import environment
8+
from SoftLayer.CLI import exceptions
89

910
target_types = {'vlan': 'SoftLayer_Network_Vlan',
1011
'ip': 'SoftLayer_Network_Subnet_IpAddress',
@@ -24,4 +25,9 @@ def cli(env, identifier, target, target_resource):
2425
"""Assigns the subnet to a target."""
2526

2627
mgr = SoftLayer.NetworkManager(env.client)
27-
mgr.route(identifier, target_types.get(target), target_resource)
28+
route = mgr.route(identifier, target_types.get(target), target_resource)
29+
30+
if route:
31+
click.secho("Route updated successfully.")
32+
else:
33+
raise exceptions.CLIAbort('Failed to route the subnet.')

0 commit comments

Comments
 (0)