{"action":"created","issue":{"url":"https://api.github.com/repos/doctormo/python-crontab/issues/7","repository_url":"https://api.github.com/repos/doctormo/python-crontab","labels_url":"https://api.github.com/repos/doctormo/python-crontab/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/doctormo/python-crontab/issues/7/comments","events_url":"https://api.github.com/repos/doctormo/python-crontab/issues/7/events","html_url":"https://github.com/doctormo/python-crontab/issues/7","id":235399630,"number":7,"title":"Deleting the earlier listed job removes shared env vars","user":{"login":"nnashok","id":10915339,"avatar_url":"https://avatars3.githubusercontent.com/u/10915339?v=3","gravatar_id":"","url":"https://api.github.com/users/nnashok","html_url":"https://github.com/nnashok","followers_url":"https://api.github.com/users/nnashok/followers","following_url":"https://api.github.com/users/nnashok/following{/other_user}","gists_url":"https://api.github.com/users/nnashok/gists{/gist_id}","starred_url":"https://api.github.com/users/nnashok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnashok/subscriptions","organizations_url":"https://api.github.com/users/nnashok/orgs","repos_url":"https://api.github.com/users/nnashok/repos","events_url":"https://api.github.com/users/nnashok/events{/privacy}","received_events_url":"https://api.github.com/users/nnashok/received_events","type":"User","site_admin":false},"labels":[{"id":588295209,"url":"https://api.github.com/repos/doctormo/python-crontab/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-13T00:06:27Z","updated_at":"2017-06-21T00:24:27Z","closed_at":"2017-06-13T14:01:33Z","body":"If I have a crontab where two jobs share an env var, e.g:\r\n```\r\n  DEBUG=1\r\n  1 * * * * echo 1 # First\r\n  2 * * * * echo 2 # Second\r\n```\r\n\r\ndeleting the first job deletes the env var completely. The second job above is then left without the env var that it was sharing with the deleted job. Following code illustrates the problem:\r\n\r\n```\r\n#!/usr/bin/env python\r\n\r\nfrom crontab import CronTab\r\n\r\ncron = CronTab(tab=\"\"\"\r\nDEBUG=1\r\n1 * * * * echo 1 # First\r\n2 * * * * echo 2 # Second\r\n\"\"\")\r\n\r\nprint('After creating the jobs')\r\nfor job in cron:\r\n    print('DEBUG: ', job.env['DEBUG'])\r\n\r\nprint('Removing the first job')\r\ncron.remove_all(comment=\"First\")\r\n\r\nprint('After removing the first job')\r\nfor job in cron:\r\n    print('DEBUG: ', job.env['DEBUG'])\r\n```"},"comment":{"url":"https://api.github.com/repos/doctormo/python-crontab/issues/comments/309928021","html_url":"https://github.com/doctormo/python-crontab/issues/7#issuecomment-309928021","issue_url":"https://api.github.com/repos/doctormo/python-crontab/issues/7","id":309928021,"user":{"login":"nnashok","id":10915339,"avatar_url":"https://avatars3.githubusercontent.com/u/10915339?v=3","gravatar_id":"","url":"https://api.github.com/users/nnashok","html_url":"https://github.com/nnashok","followers_url":"https://api.github.com/users/nnashok/followers","following_url":"https://api.github.com/users/nnashok/following{/other_user}","gists_url":"https://api.github.com/users/nnashok/gists{/gist_id}","starred_url":"https://api.github.com/users/nnashok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnashok/subscriptions","organizations_url":"https://api.github.com/users/nnashok/orgs","repos_url":"https://api.github.com/users/nnashok/repos","events_url":"https://api.github.com/users/nnashok/events{/privacy}","received_events_url":"https://api.github.com/users/nnashok/received_events","type":"User","site_admin":false},"created_at":"2017-06-21T00:24:27Z","updated_at":"2017-06-21T00:24:27Z","body":"I tested the code from github and the fix works as expected. If you can release it, that would be great."}}
{"actor":{"display_login":"nnashok"}}