aboutsummaryrefslogtreecommitdiff
path: root/admin.py
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@linaro.org>2014-12-05 18:08:21 +0000
committerSteve McIntyre <steve.mcintyre@linaro.org>2014-12-05 18:08:21 +0000
commite41e3f38da243dc89b7ec97ed12fd3ba88a38a97 (patch)
treea45dbdcdaeae1b4cafa49246fcba5b8f1cf3ef96 /admin.py
parenta0534a5928c0b94cd9bbe2bdd833e472c0dfce47 (diff)
Implement show_vlan
Change-Id: I5ae1211a4d944a93f91d95970156175862eb54f5
Diffstat (limited to 'admin.py')
-rw-r--r--admin.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/admin.py b/admin.py
index 64a869a..00971ea 100644
--- a/admin.py
+++ b/admin.py
@@ -49,6 +49,9 @@ def dump_switch(switch):
def dump_port(port):
print port
+def dump_vlan(vlan):
+ print vlan
+
#print '%s' % banner
#print 'Connecting to DB...'
@@ -420,5 +423,14 @@ elif opts.restore_port_to_base_vlan is not None:
print "Restored port_id %d back to base VLAN" % port_id
except InputError as inst:
print 'Failed: %s' % inst
+elif opts.show_vlan is not None:
+ try:
+ vlan = db.get_vlan_by_id(opts.show_vlan)
+ if vlan is not None:
+ dump_vlan(vlan)
+ else:
+ print 'No vlan found for vlan_id %d' % opts.show_vlan
+ except InputError as inst:
+ print 'Failed: %s' % inst
else:
print 'No recognised command given. Try -h for help'