summaryrefslogtreecommitdiff
path: root/lorrycontroller/workingstate.py
diff options
context:
space:
mode:
Diffstat (limited to 'lorrycontroller/workingstate.py')
-rw-r--r--lorrycontroller/workingstate.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lorrycontroller/workingstate.py b/lorrycontroller/workingstate.py
index acaf55b..239ee1f 100644
--- a/lorrycontroller/workingstate.py
+++ b/lorrycontroller/workingstate.py
@@ -32,7 +32,7 @@ class LorryFileRunner(object):
def run_lorry(self, *args):
cmdargs = list(args)
cmdargs.append(self.lorryfile)
- self.mgr.app.runcmd(cmdargs)
+ self.mgr.app.maybe_runcmd(cmdargs)
class WorkingStateManager(object):
'''Manage the working state of lorry-controller'''
@@ -46,7 +46,10 @@ class WorkingStateManager(object):
return self
def __exit__(self, exctype, excvalue, exctraceback):
- self.save_state()
+ if not self.app.settings['dry-run']:
+ self.save_state()
+ else:
+ logging.debug("DRY-RUN: Not saving state again")
def _load_state(self):
self.lorry_state_file = os.path.join(self.workdir,