{"action":"created","issue":{"url":"https://api.github.com/repos/nvie/rq/issues/612","labels_url":"https://api.github.com/repos/nvie/rq/issues/612/labels{/name}","comments_url":"https://api.github.com/repos/nvie/rq/issues/612/comments","events_url":"https://api.github.com/repos/nvie/rq/issues/612/events","html_url":"https://github.com/nvie/rq/issues/612","id":118228150,"number":612,"title":"Not able to use it with Fabric task","user":{"login":"abhigogna","id":10958674,"avatar_url":"https://avatars.githubusercontent.com/u/10958674?v=3","gravatar_id":"","url":"https://api.github.com/users/abhigogna","html_url":"https://github.com/abhigogna","followers_url":"https://api.github.com/users/abhigogna/followers","following_url":"https://api.github.com/users/abhigogna/following{/other_user}","gists_url":"https://api.github.com/users/abhigogna/gists{/gist_id}","starred_url":"https://api.github.com/users/abhigogna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhigogna/subscriptions","organizations_url":"https://api.github.com/users/abhigogna/orgs","repos_url":"https://api.github.com/users/abhigogna/repos","events_url":"https://api.github.com/users/abhigogna/events{/privacy}","received_events_url":"https://api.github.com/users/abhigogna/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-21T23:48:51Z","updated_at":"2015-11-22T01:43:30Z","closed_at":null,"body":"I am not sure if this is the right place to ask this question but dont know where to ask.\r\n\r\nI have been trying to integrate python-rq with fabric tasks. Goal is to run fabric tasks asynchronously. \r\nhere is my fabric script:\r\n\r\n    env.password=\"test\"\r\n    #env.parallel=True\r\n\r\n    class FabricSupport:\r\n        def __init__(self):\r\n            pass\r\n\r\n        def hostname(self):\r\n             run(\"hostname\")\r\n\r\n         def df(self):\r\n              run(\"df -h\")\r\n\r\n        def execute(self,task,hosts):\r\n             get_task = \"task = self.%s\" % task\r\n             exec get_task\r\n             execute(task,hosts=hosts)\r\n\r\nBut when i try to queue it with python-rq, I get \"AttributeError: 'NoneType' object has no attribute '__module__'\"\r\n\r\n      myfab = FabricSupport()\r\n      q.enqueue(myfab.execute(\"hostname\",hosts=['127.0.0.1']))\r\n\r\nI understand that fabric will not return anything back. It just executes it.\r\nI am sure there is some trivial solution but can't seem to find it from the docs. Unless this is not supported as of yet.\r\n"},"comment":{"url":"https://api.github.com/repos/nvie/rq/issues/comments/158699194","html_url":"https://github.com/nvie/rq/issues/612#issuecomment-158699194","issue_url":"https://api.github.com/repos/nvie/rq/issues/612","id":158699194,"user":{"login":"abhigogna","id":10958674,"avatar_url":"https://avatars.githubusercontent.com/u/10958674?v=3","gravatar_id":"","url":"https://api.github.com/users/abhigogna","html_url":"https://github.com/abhigogna","followers_url":"https://api.github.com/users/abhigogna/followers","following_url":"https://api.github.com/users/abhigogna/following{/other_user}","gists_url":"https://api.github.com/users/abhigogna/gists{/gist_id}","starred_url":"https://api.github.com/users/abhigogna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhigogna/subscriptions","organizations_url":"https://api.github.com/users/abhigogna/orgs","repos_url":"https://api.github.com/users/abhigogna/repos","events_url":"https://api.github.com/users/abhigogna/events{/privacy}","received_events_url":"https://api.github.com/users/abhigogna/received_events","type":"User","site_admin":false},"created_at":"2015-11-22T01:43:30Z","updated_at":"2015-11-22T01:43:30Z","body":"I have found a workaround. As long as I return something from my function then rq is happy.\r\n\r\n         def execute(self,task,hosts):\r\n                get_task = \"task = self.%s\" % task\r\n                exec get_task\r\n                execute(task,hosts=hosts)\r\n                return \"process complete\""}}