Use os module for checking absolute/joining paths

This commit is contained in:
Doug Luce 2016-03-03 15:10:19 -08:00
parent 84def4398f
commit 0298dac401

View file

@ -129,9 +129,10 @@ class CronVar(object):
if cron_file:
self.cron_file = ""
if cron_file[0] != '/':
self.cron_file = '/etc/cron.d/'
self.cron_file = self.cron_file + cron_file
if os.path.isabs(cron_file):
self.cron_file = cron_file
else:
self.cron_file = os.path.join('/etc/cron.d', cron_file)
else:
self.cron_file = None