From a0ba89ecfdeffb3fc50b2a6ac4fc6a7b5ec1798a Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 15 Jun 2019 17:31:29 -0500 Subject: [PATCH] Mock out the tempmon client restart action when testing --- rattail_demo/web/views/tempmon.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rattail_demo/web/views/tempmon.py b/rattail_demo/web/views/tempmon.py index fe72b81..8b36dce 100644 --- a/rattail_demo/web/views/tempmon.py +++ b/rattail_demo/web/views/tempmon.py @@ -24,7 +24,10 @@ class TempmonClientView(BaseTempmonClientView): return client.config_key == 'demo' def get_restart_cmd(self, client): - return ['ssh', 'demo.rattailproject.org', 'sudo service demo-tempmon-client restart'] + if self.rattail_config.production(): + return ['ssh', 'demo.rattailproject.org', 'sudo service demo-tempmon-client restart'] + # just mock it out when testing + return ['sleep', '2'] class TempmonProbeView(BaseTempmonProbeView):