fix files error handling
This commit is contained in:
parent
1b01905327
commit
9a38695777
@ -21,7 +21,7 @@ SELF = os.path.basename(sys.argv[0])
|
||||
|
||||
try:
|
||||
os.makedirs(TIMERS_DIR)
|
||||
except IOError as e:
|
||||
except OSError as e:
|
||||
if e.errno != os.errno.EEXIST:
|
||||
raise
|
||||
|
||||
@ -185,7 +185,11 @@ AccuracySec=%sm
|
||||
%s
|
||||
''' % (SELF, job['f'], job['l'], unit_name, accuracy, schedule))
|
||||
|
||||
os.symlink('%s/%s.timer' % (TARGER_DIR, unit_name), '%s/%s.timer' % (TIMERS_DIR, unit_name))
|
||||
try:
|
||||
os.symlink('%s/%s.timer' % (TARGER_DIR, unit_name), '%s/%s.timer' % (TIMERS_DIR, unit_name))
|
||||
except OSError as e:
|
||||
if e.errno != os.errno.EEXIST:
|
||||
raise
|
||||
|
||||
with open('%s/%s.service' % (TARGER_DIR, unit_name), 'w') as f:
|
||||
f.write('''# Automatically generated by %s
|
||||
|
Loading…
Reference in New Issue
Block a user