allow spaces in cron env

This commit is contained in:
Daniel Wallace 2016-12-29 11:13:15 -06:00
parent c529ec8c34
commit c480c11528

View file

@ -336,6 +336,13 @@ def list_tab(user):
comment = comment_line
else:
comment += '\n' + comment_line
elif line.find('=') > 0 and (' ' not in line or line.index('=') < line.index(' ')):
# Appears to be a ENV setup line
comps = line.split('=', 1)
dat = {}
dat['name'] = comps[0]
dat['value'] = comps[1]
ret['env'].append(dat)
elif len(line.split(' ')) > 5:
# Appears to be a standard cron line
comps = line.split(' ')
@ -354,13 +361,6 @@ def list_tab(user):
identifier = None
comment = None
commented_cron_job = False
elif line.find('=') > 0:
# Appears to be a ENV setup line
comps = line.split('=')
dat = {}
dat['name'] = comps[0]
dat['value'] = ' '.join(comps[1:])
ret['env'].append(dat)
else:
ret['pre'].append(line)
return ret