)]}'
{"jenkins/__init__.py":[{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"cd336dbb77f665f172adcda667f5ecee79e1c3be","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        if self.crumb is None:"},{"line_number":177,"context_line":"            response \u003d self.jenkins_open(Request("},{"line_number":178,"context_line":"                self.server + CRUMB_URL), add_crumb\u003dFalse)"},{"line_number":179,"context_line":"            if response:"},{"line_number":180,"context_line":"                self.crumb \u003d json.loads(response.decode(\u0027utf-8\u0027))"},{"line_number":181,"context_line":"            else:"},{"line_number":182,"context_line":"                # Don\u0027t need crumbs"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_577130a7","line":179,"updated":"2015-01-12 18:35:55.000000000","message":"You need to handle the NotFoundException here for systems that do not have the crumb enabled since a 404 is a valid result when querying the crumb url. Following diff will do the trick:\n\n --- a/jenkins/__init__.py\n +++ b/jenkins/__init__.py\n @@ -174,13 +174,14 @@ class Jenkins(object):\n      def maybe_add_crumb(self, req):\n          # We don\u0027t know yet whether we need a crumb\n          if self.crumb is None:\n -            response \u003d self.jenkins_open(Request(\n -                self.server + CRUMB_URL), add_crumb\u003dFalse)\n -            if response:\n -                self.crumb \u003d json.loads(response.decode(\u0027utf-8\u0027))\n -            else:\n +            try:\n +                response \u003d self.jenkins_open(Request(\n +                    self.server + CRUMB_URL), add_crumb\u003dFalse)\n +            except NotFoundException:\n                  # Don\u0027t need crumbs\n                  self.crumb \u003d False\n +            else:\n +                self.crumb \u003d json.loads(response.decode(\u0027utf-8\u0027))\n          if self.crumb:\n              req.add_header(self.crumb[\u0027crumbRequestField\u0027], self.crumb[\u0027crumb\u0027])","commit_id":"fd6feae32773c32bed887a9687440baf95f935df"},{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"6514699979ce707381a63c047d97b8d7eef726f9","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        :param name: Job name, ``str``"},{"line_number":216,"context_line":"        :returns: Name of job or None"},{"line_number":217,"context_line":"        \u0027\u0027\u0027"},{"line_number":218,"context_line":"        response \u003d self.jenkins_open("},{"line_number":219,"context_line":"            Request(self.server + JOB_NAME % self._get_encoded_params(locals())))"},{"line_number":220,"context_line":"        if response:"},{"line_number":221,"context_line":"            actual \u003d json.loads(response)[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_1c07a1ca","line":218,"updated":"2015-01-13 20:02:03.000000000","message":"Note that this will now raise an exception where previously it did not.","commit_id":"2fb0d53f634093a5dd1a70791b5116dbc8607075"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e01c658ad21097ccd2afe91d31d8724a85083737","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        :param name: Job name, ``str``"},{"line_number":216,"context_line":"        :returns: Name of job or None"},{"line_number":217,"context_line":"        \u0027\u0027\u0027"},{"line_number":218,"context_line":"        response \u003d self.jenkins_open("},{"line_number":219,"context_line":"            Request(self.server + JOB_NAME % self._get_encoded_params(locals())))"},{"line_number":220,"context_line":"        if response:"},{"line_number":221,"context_line":"            actual \u003d json.loads(response)[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_d7a33241","line":218,"in_reply_to":"3a961159_1c07a1ca","updated":"2015-01-13 20:49:21.000000000","message":"There are two ways I can deal with this: I could let the exception continue to be raised, or I could wrap in a try/except and maintain the previous calling convention.  Which do you think is best?","commit_id":"2fb0d53f634093a5dd1a70791b5116dbc8607075"},{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"3c61570d65323edc0123abcc2494712462b240df","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        :param name: Job name, ``str``"},{"line_number":216,"context_line":"        :returns: Name of job or None"},{"line_number":217,"context_line":"        \u0027\u0027\u0027"},{"line_number":218,"context_line":"        response \u003d self.jenkins_open("},{"line_number":219,"context_line":"            Request(self.server + JOB_NAME % self._get_encoded_params(locals())))"},{"line_number":220,"context_line":"        if response:"},{"line_number":221,"context_line":"            actual \u003d json.loads(response)[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_4f1eca0e","line":218,"in_reply_to":"3a961159_d7a33241","updated":"2015-01-13 21:56:26.000000000","message":"I\u0027ll have to leave that to the project maintainer, but I\u0027m guessing that for this to raise an exception it\u0027s an api change and probably requires some notes added to let consumers know along with a version bump.","commit_id":"2fb0d53f634093a5dd1a70791b5116dbc8607075"},{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"6514699979ce707381a63c047d97b8d7eef726f9","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        \u0027\u0027\u0027"},{"line_number":218,"context_line":"        response \u003d self.jenkins_open("},{"line_number":219,"context_line":"            Request(self.server + JOB_NAME % self._get_encoded_params(locals())))"},{"line_number":220,"context_line":"        if response:"},{"line_number":221,"context_line":"            actual \u003d json.loads(response)[\u0027name\u0027]"},{"line_number":222,"context_line":"            if actual !\u003d name:"},{"line_number":223,"context_line":"                raise JenkinsException("}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_3caffd7e","line":220,"updated":"2015-01-13 20:02:03.000000000","message":"I believe that previously if the job didn\u0027t exist, response would be empty here so this method used to return None.","commit_id":"2fb0d53f634093a5dd1a70791b5116dbc8607075"},{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"6514699979ce707381a63c047d97b8d7eef726f9","unresolved":false,"context_lines":[{"line_number":523,"context_line":""},{"line_number":524,"context_line":"        :param name: Name of Jenkins job, ``str``"},{"line_number":525,"context_line":"        :returns: ``True`` if Jenkins job exists"},{"line_number":526,"context_line":"        \u0027\u0027\u0027"},{"line_number":527,"context_line":"        if self.get_job_name(name) \u003d\u003d name:"},{"line_number":528,"context_line":"            return True"},{"line_number":529,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_3c57fdcb","line":526,"updated":"2015-01-13 20:02:03.000000000","message":"Just realised this will now trigger an exception, which is not the same as before. Previously it returned False if the job didn\u0027t exist.","commit_id":"2fb0d53f634093a5dd1a70791b5116dbc8607075"},{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"6514699979ce707381a63c047d97b8d7eef726f9","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        :param exception_message: Message to use for the exception. Formatted"},{"line_number":536,"context_line":"                                  with ``name``"},{"line_number":537,"context_line":"        :throws: :class:`JenkinsException` whenever the job does not exist"},{"line_number":538,"context_line":"        \u0027\u0027\u0027"},{"line_number":539,"context_line":"        if not self.job_exists(name):"},{"line_number":540,"context_line":"            raise JenkinsException(exception_message % name)"},{"line_number":541,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_1cd5e11a","line":538,"updated":"2015-01-13 20:02:03.000000000","message":"The fact that this call will result in an exception if the job does not exist makes the raise statement below redundant.","commit_id":"2fb0d53f634093a5dd1a70791b5116dbc8607075"}],"tests/test_jenkins.py":[{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"f6a95f4a3033224c765813a2b05b920d7e1f5774","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        self.assertEqual("},{"line_number":182,"context_line":"            jenkins_mock.call_args[0][0].get_full_url(),"},{"line_number":183,"context_line":"            \u0027http://example.com/job/TestJob\u0027)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    @patch.object(jenkins.Jenkins, \u0027jenkins_open\u0027)"},{"line_number":186,"context_line":"    def test_assert_job_exists__job_missing(self, jenkins_mock):"},{"line_number":187,"context_line":"        jenkins_mock.side_effect \u003d ["}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_fc29f5f2","line":184,"updated":"2015-01-13 20:04:56.000000000","message":"Two tests below look like they should be potentially updated have jenkins_open return a 404.","commit_id":"2fb0d53f634093a5dd1a70791b5116dbc8607075"},{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"bc0114d3f8a058d2333ca65b9b6e249338d55009","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        self.assertEqual("},{"line_number":182,"context_line":"            jenkins_mock.call_args[0][0].get_full_url(),"},{"line_number":183,"context_line":"            \u0027http://example.com/job/TestJob\u0027)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    @patch.object(jenkins.Jenkins, \u0027jenkins_open\u0027)"},{"line_number":186,"context_line":"    def test_assert_job_exists__job_missing(self, jenkins_mock):"},{"line_number":187,"context_line":"        jenkins_mock.side_effect \u003d ["}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_1d65db1c","line":184,"in_reply_to":"3a961159_024c9a75","updated":"2015-01-13 21:48:15.000000000","message":"Ah, sorry, I was wrong about the second one. Due to comment and run!","commit_id":"2fb0d53f634093a5dd1a70791b5116dbc8607075"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"ca1cd3c8214c4234c90ddc74f894086d53602581","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        self.assertEqual("},{"line_number":182,"context_line":"            jenkins_mock.call_args[0][0].get_full_url(),"},{"line_number":183,"context_line":"            \u0027http://example.com/job/TestJob\u0027)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    @patch.object(jenkins.Jenkins, \u0027jenkins_open\u0027)"},{"line_number":186,"context_line":"    def test_assert_job_exists__job_missing(self, jenkins_mock):"},{"line_number":187,"context_line":"        jenkins_mock.side_effect \u003d ["}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_024c9a75","line":184,"in_reply_to":"3a961159_fc29f5f2","updated":"2015-01-13 20:54:04.000000000","message":"Could you comment on the second test, so I can see which one you mean?  I can see how test_assert_job_exists__job_missing() needs to be amended, but test_assert_job_exists__job_exists()  looks like it\u0027s intended for the non-404 case…","commit_id":"2fb0d53f634093a5dd1a70791b5116dbc8607075"}]}
