[mod] use python instead of os.system

This commit is contained in:
Laurent Peuch 2016-06-12 00:35:23 +02:00
parent cf3e28786c
commit c4cecfcea5

View file

@ -108,7 +108,7 @@ def app_fetchlist(url=None, name=None):
# Rename fetched temp list
os.rename('%s.tmp' % list_file, list_file)
os.system("echo '00 00 * * * root yunohost app fetchlist -u %s -n %s > /dev/null 2>&1' >/etc/cron.d/yunohost-applist-%s" % (url, name, name))
open("/etc/cron.d/yunohost-applist-%s" % name, "w").write('00 00 * * * root yunohost app fetchlist -u %s -n %s > /dev/null 2>&1\n' % (url, name))
logger.success(m18n.n('appslist_fetched'))