From 9419c3675501b082191283cb7cd53f8a7bd06733 Mon Sep 17 00:00:00 2001 From: Konstantin Stepanov Date: Wed, 22 Dec 2010 15:55:47 +0200 Subject: [PATCH] dbuscrontab: config file argument is accepted by all actions --- dbuscron/shell/edit.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dbuscron/shell/edit.py b/dbuscron/shell/edit.py index e47dcc0..0f41a48 100644 --- a/dbuscron/shell/edit.py +++ b/dbuscron/shell/edit.py @@ -1,6 +1,5 @@ import os, sys, shutil, signal, tempfile, pipes -conffile = '/etc/dbuscrontab' pidfile = '/var/run/dbuscron.pid' from dbuscron.parser import CrontabParser, CrontabParserError @@ -56,11 +55,12 @@ def run(): action = None try: - if action == '-e': + conffile = sys.argv[2] + except IndexError: + conffile = '/etc/dbuscrontab' - # 0. get custom config file to edit - if len(sys.argv) > 2: - conffile = sys.argv[2] + try: + if action == '-e': # 1. create temporary config file copy temp_file = create_temp_file(conffile) -- 1.7.9.5