)]}'
{"doc/source/example.rst":[{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"ee06fa3546d24033650fda821e759495dde6389e","unresolved":false,"context_lines":[{"line_number":12,"context_line":"    j.enable_job(\u0027empty_copy\u0027)"},{"line_number":13,"context_line":"    j.reconfig_job(\u0027empty_copy\u0027, jenkins.RECONFIG_XML)"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"    # shutdown Jenkins safely"},{"line_number":16,"context_line":"    j.safe_shutdown()"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"    j.delete_job(\u0027empty\u0027)"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9a41bdd9_8ea21efc","line":15,"updated":"2015-07-14 17:26:24.000000000","message":"this example seems out of place here.  would it be possible to create completely new example for this?  Maybe call it \u0027Automate Jenkins Example::\u0027?  Then maybe change this section to \u0027Managing Jenkins Jobs Example::\u0027?  Or if you don\u0027t fee like it, then I\u0027m fine with the example you provided in the safe_shutdown api.","commit_id":"751543c0b61281151c95b719ad7229908d5bf3b5"}],"jenkins/__init__.py":[{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"ee06fa3546d24033650fda821e759495dde6389e","unresolved":false,"context_lines":[{"line_number":1001,"context_line":"        request \u003d Request(self.server + CONFIG_VIEW % self._get_encoded_params(locals()))"},{"line_number":1002,"context_line":"        return self.jenkins_open(request)"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"    def assert_shutdown(self, exception_message\u003d\u0027jenkins is not shutting down\u0027):"},{"line_number":1005,"context_line":"        \u0027\u0027\u0027Raise an exception if jenkins is not shutting down or not in quiet down mode."},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"        When Jenkins is shutdown safely, it waits for completion of ongoing"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_f1faab74","line":1004,"updated":"2015-07-14 17:26:24.000000000","message":"would \u0027assert_shutting_down\u0027 be a better name?","commit_id":"751543c0b61281151c95b719ad7229908d5bf3b5"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"ee06fa3546d24033650fda821e759495dde6389e","unresolved":false,"context_lines":[{"line_number":1002,"context_line":"        return self.jenkins_open(request)"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"    def assert_shutdown(self, exception_message\u003d\u0027jenkins is not shutting down\u0027):"},{"line_number":1005,"context_line":"        \u0027\u0027\u0027Raise an exception if jenkins is not shutting down or not in quiet down mode."},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"        When Jenkins is shutdown safely, it waits for completion of ongoing"},{"line_number":1008,"context_line":"        builds. First check is done to see if Jenkins is shutdown directly"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_8e33feaa","line":1005,"updated":"2015-07-14 17:26:24.000000000","message":"would you mind wrapping to \u003c 80 chars?","commit_id":"751543c0b61281151c95b719ad7229908d5bf3b5"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"ee06fa3546d24033650fda821e759495dde6389e","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"    def assert_shutdown(self, exception_message\u003d\u0027jenkins is not shutting down\u0027):"},{"line_number":1005,"context_line":"        \u0027\u0027\u0027Raise an exception if jenkins is not shutting down or not in quiet down mode."},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"        When Jenkins is shutdown safely, it waits for completion of ongoing"},{"line_number":1008,"context_line":"        builds. First check is done to see if Jenkins is shutdown directly"},{"line_number":1009,"context_line":"        since there was no ongoing builds. This is done by getting version of Jenkins."},{"line_number":1010,"context_line":"        If we get an exception, it means that Jenkins is already shutdown."}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_2713f55c","line":1007,"updated":"2015-07-14 17:26:24.000000000","message":"I\u0027m wondering whether some of this documentation would be more appropriate in safe_shutdown()","commit_id":"751543c0b61281151c95b719ad7229908d5bf3b5"},{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"3c39a83923cf18c55a414d807652b9d4304d4d15","unresolved":false,"context_lines":[{"line_number":1012,"context_line":"        is waiting for their completion and it is taken to quiet down mode."},{"line_number":1013,"context_line":"        If none is valid then an exception is thrown."},{"line_number":1014,"context_line":""},{"line_number":1015,"context_line":"        :throws: :class:`JenkinsException` whenever the Jenkins is not possible"},{"line_number":1016,"context_line":"            to shutdown"},{"line_number":1017,"context_line":"        \u0027\u0027\u0027"},{"line_number":1018,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_753e7edb","line":1015,"updated":"2015-07-14 19:53:28.000000000","message":"Maybe a specific exception required here instead of asking consumers to inspect the exception string.","commit_id":"751543c0b61281151c95b719ad7229908d5bf3b5"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"ee06fa3546d24033650fda821e759495dde6389e","unresolved":false,"context_lines":[{"line_number":1017,"context_line":"        \u0027\u0027\u0027"},{"line_number":1018,"context_line":""},{"line_number":1019,"context_line":"        try:"},{"line_number":1020,"context_line":"            self.get_version()"},{"line_number":1021,"context_line":"        except URLError:"},{"line_number":1022,"context_line":"            pass"},{"line_number":1023,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_2ca3da9e","line":1020,"updated":"2015-07-14 17:26:24.000000000","message":"In cases where Jenkins is starting but not fully able to accept REST request this will throw a \u0027jenkins.BadHTTPException jenkins.BadHTTPException: Error communicating with server\u0027 exception.  Maybe catch that exception as well?  But i\u0027m not sure whether that would be considered in \u0027shutdown\u0027 or not.  I\u0027m inclined to consider this a shutdown state because you can\u0027t interact with Jenkins in this state.  Whichever you decide there should be some comments to explain the logic.","commit_id":"751543c0b61281151c95b719ad7229908d5bf3b5"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"ee06fa3546d24033650fda821e759495dde6389e","unresolved":false,"context_lines":[{"line_number":1022,"context_line":"            pass"},{"line_number":1023,"context_line":"        else:"},{"line_number":1024,"context_line":"            script \u003d \u0027hudson.model.Hudson.instance.isTerminating()\u0027"},{"line_number":1025,"context_line":"            if not self.run_script(script):"},{"line_number":1026,"context_line":"                raise JenkinsException(exception_message)"},{"line_number":1027,"context_line":""},{"line_number":1028,"context_line":"    def safe_shutdown(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_711a1b7f","line":1025,"updated":"2015-07-14 17:26:24.000000000","message":"Script is not necessary here.  You can get the same info from the REST API by issuing jenkins.get_info()[\u0027quietingDown\u0027].  Do you know if there\u0027s a benefit to running a script in this case?","commit_id":"751543c0b61281151c95b719ad7229908d5bf3b5"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"ee06fa3546d24033650fda821e759495dde6389e","unresolved":false,"context_lines":[{"line_number":1034,"context_line":"        \u0027\u0027\u0027"},{"line_number":1035,"context_line":"        script \u003d \u0027hudson.model.Hudson.instance.doSafeExit(null)\u0027"},{"line_number":1036,"context_line":"        self.run_script(script)"},{"line_number":1037,"context_line":"        time.sleep(2)"},{"line_number":1038,"context_line":"        self.assert_shutdown()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_f1e94be7","line":1037,"updated":"2015-07-14 17:26:24.000000000","message":"what happens if it takes more time to shutdown, like when there\u0027s a long running job?  This will assert \"jenkins is not shutting down\"?  But that\u0027s not actually correct because it will shutdown after all jobs complete correct?  I think these 2 options might be better:\n\n1.  Don\u0027t bother asserting that jenkins has shutdown.  Just tell user that \"Safe shutdown initiated, jenkins will shutdown once all jobs have completed\". \n\n2. If you prefer to assert that Jenkins has shutdown then I think we need to poll jenkins to make sure it\u0027s shutdown.  I think in this scenario i would just use the get_version() to check whether it\u0027s still up.","commit_id":"751543c0b61281151c95b719ad7229908d5bf3b5"},{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"3c39a83923cf18c55a414d807652b9d4304d4d15","unresolved":false,"context_lines":[{"line_number":1034,"context_line":"        \u0027\u0027\u0027"},{"line_number":1035,"context_line":"        script \u003d \u0027hudson.model.Hudson.instance.doSafeExit(null)\u0027"},{"line_number":1036,"context_line":"        self.run_script(script)"},{"line_number":1037,"context_line":"        time.sleep(2)"},{"line_number":1038,"context_line":"        self.assert_shutdown()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_954c629f","line":1037,"in_reply_to":"9a41bdd9_f1e94be7","updated":"2015-07-14 19:53:28.000000000","message":"For option 2, perhaps it should check for get_info()[\u0027quietingDown\u0027] and other states. After all once it\u0027s in quieting down phase, if you\u0027re polling until it completes, depending on the timeout it may be possible (if not improbable) for it to have completed coming back up between polls.","commit_id":"751543c0b61281151c95b719ad7229908d5bf3b5"}],"tests/test_jenkins.py":[{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"ee06fa3546d24033650fda821e759495dde6389e","unresolved":false,"context_lines":[{"line_number":1872,"context_line":"        self._check_requests(jenkins_mock.call_args_list)"},{"line_number":1873,"context_line":""},{"line_number":1874,"context_line":"    @patch.object(jenkins.Jenkins, \u0027jenkins_open\u0027)"},{"line_number":1875,"context_line":"    def test_safe_shutdown(self, urlopen_mock):"},{"line_number":1876,"context_line":"        j \u003d jenkins.Jenkins(\u0027http://example.com/\u0027, \u0027test\u0027, \u0027test\u0027)"},{"line_number":1877,"context_line":"        j.safe_shutdown()"},{"line_number":1878,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_e7466d4e","line":1875,"updated":"2015-07-14 17:26:24.000000000","message":"would like to see test case for assert_shutdown to exercise all paths in that method.","commit_id":"751543c0b61281151c95b719ad7229908d5bf3b5"}]}
