Add support for a shutdown call from the admin interface
Make sure we clean up properly and close connections.
Change-Id: Iec3fede61615d4f9e4a5561006c182e7785c1977
diff --git a/admin.py b/admin.py
index c91bfba..4acb13a 100644
--- a/admin.py
+++ b/admin.py
@@ -103,6 +103,11 @@
action = "store_true",
default = False,
help = "Probe all the configured switches")
+system_group.add_option("--shutdown",
+ dest = "shutdown",
+ action = "store_true",
+ default = False,
+ help = "Shut down a running VLANd")
parser.add_option_group(system_group)
# May add shutdown, self-check etc. later
@@ -551,5 +556,10 @@
ret = call_vland('daemon_query',{'command':'daemon.probe_switches', 'data': None})
for field in ret:
print '%s: %s' % (field, ret[field])
+elif opts.shutdown:
+ print 'Asking VLANd to shutdown'
+ ret = call_vland('daemon_query',{'command':'daemon.shutdown', 'data': None})
+ for field in ret:
+ print '%s: %s' % (field, ret[field])
else:
print 'No recognised command given. Try -h for help'