From d8c4f92aa57f8f2d59c5fd216c7ae23e2cd1b48d Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 7 Dec 2016 16:00:00 -0600 Subject: [PATCH] Tweak tempmon views a little, fix client restart logic --- tailbone/views/tempmon/clients.py | 3 ++- tailbone/views/tempmon/probes.py | 1 + tailbone/views/tempmon/readings.py | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tailbone/views/tempmon/clients.py b/tailbone/views/tempmon/clients.py index 22db63df..92d8f062 100644 --- a/tailbone/views/tempmon/clients.py +++ b/tailbone/views/tempmon/clients.py @@ -64,6 +64,7 @@ class TempmonClientView(MasterView): Master view for tempmon clients. """ model_class = tempmon.Client + model_title = "TempMon Client" route_prefix = 'tempmon.clients' url_prefix = '/tempmon/clients' @@ -107,7 +108,7 @@ class TempmonClientView(MasterView): def restart(self): client = self.get_instance() try: - subprocess.check_output(['ssh', client.hostname, 'sudo service tempmon restart'], + subprocess.check_output(['ssh', client.hostname, 'sudo service tempmon-client restart'], stderr=subprocess.STDOUT) except subprocess.CalledProcessError as error: self.request.session.flash("Failed to restart client: {}".format(error.output), 'error') diff --git a/tailbone/views/tempmon/probes.py b/tailbone/views/tempmon/probes.py index 529e76eb..aed366da 100644 --- a/tailbone/views/tempmon/probes.py +++ b/tailbone/views/tempmon/probes.py @@ -37,6 +37,7 @@ class TempmonProbeView(MasterView): Master view for tempmon probes. """ model_class = tempmon.Probe + model_title = "TempMon Probe" route_prefix = 'tempmon.probes' url_prefix = '/tempmon/probes' diff --git a/tailbone/views/tempmon/readings.py b/tailbone/views/tempmon/readings.py index 9f0c76dc..db3f5600 100644 --- a/tailbone/views/tempmon/readings.py +++ b/tailbone/views/tempmon/readings.py @@ -36,11 +36,16 @@ class TempmonReadingView(MasterView): Master view for tempmon readings. """ model_class = tempmon.Reading + model_title = "TempMon Reading" route_prefix = 'tempmon.readings' url_prefix = '/tempmon/readings' creatable = False editable = False + def _preconfigure_grid(self, g): + g.default_sortkey = 'taken' + g.default_sortdir = 'desc' + def configure_grid(self, g): g.configure( include=[