)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"46bebd9c8c7df7bdcdb00a357e973ad258412a20","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Remove support for psutil \u003c3"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Global requirements was recently updated to force psutil to always be"},{"line_number":10,"context_line":"newer than version 3. This removes support for older versions of psutil"},{"line_number":11,"context_line":"as well as changing to opportunistically trying to work if a version \u003e5"},{"line_number":12,"context_line":"is released but doesn\u0027t change the interface we use."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a461143_1f4e4c96","line":10,"updated":"2017-01-26 19:36:25.000000000","message":"so that is true if you mean 3.0, but the requirement now is \u003e\u003d3.0.1. Would be good to reword this, otherwise it could be confusing (e.g. I interpreted that as being \u003e\u003d 4.0).","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"},{"author":{"_account_id":22860,"name":"Solio Sarabia","email":"solio.sarabia@intel.com","username":"ssarabia"},"change_message_id":"f7f4de2b128e97e6056ed3c9e2a30af0649ed115","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Remove support for psutil \u003c3"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Global requirements was recently updated to force psutil to always be"},{"line_number":10,"context_line":"newer than version 3. This removes support for older versions of psutil"},{"line_number":11,"context_line":"as well as changing to opportunistically trying to work if a version \u003e5"},{"line_number":12,"context_line":"is released but doesn\u0027t change the interface we use."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a461143_b51e3761","line":10,"in_reply_to":"3a461143_1f4e4c96","updated":"2017-01-26 19:59:10.000000000","message":"+1: We should go for something like \"...force psutil starting from 3.0.1 and newer\".","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"}],"ironic_python_agent/hardware.py":[{"author":{"_account_id":22860,"name":"Solio Sarabia","email":"solio.sarabia@intel.com","username":"ssarabia"},"change_message_id":"80660872ad5b146551a93af105985956e3ac3d20","unresolved":false,"context_lines":[{"line_number":597,"context_line":"        if psutil.version_info[0] \u003d\u003d 1:"},{"line_number":598,"context_line":"            total \u003d int(psutil.TOTAL_PHYMEM)"},{"line_number":599,"context_line":"        elif psutil.version_info[0] \u003d\u003d 2:"},{"line_number":600,"context_line":"            total \u003d int(psutil.phymem_usage().total)"},{"line_number":601,"context_line":"        elif psutil.version_info[0] in (3, 4, 5):"},{"line_number":602,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":603,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_9873724d","line":600,"range":{"start_line":600,"start_character":0,"end_line":600,"end_character":52},"updated":"2017-01-25 18:16:30.000000000","message":"No need to update this but psutil.virtual_memory() is available since psutils 2.0.0. psutils.phymem_usage() will work, it\u0027ll just print a deprecation warning.\n\nhttps://github.com/giampaolo/psutil/blob/master/HISTORY.rst#200","commit_id":"3ff61c9a453f75242fb9418f4ad9451bd57ccf66"},{"author":{"_account_id":22860,"name":"Solio Sarabia","email":"solio.sarabia@intel.com","username":"ssarabia"},"change_message_id":"4bafefec289ed4be1a5bf63f68c1838b26bcc8c5","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    def get_memory(self):"},{"line_number":596,"context_line":"        try:"},{"line_number":597,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":598,"context_line":"        except:"},{"line_number":599,"context_line":"            total \u003d None"},{"line_number":600,"context_line":"            LOG.exception(\"Cannot fetch total memory size using psutil.\")"},{"line_number":601,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a461143_e1e9e91b","line":598,"range":{"start_line":598,"start_character":8,"end_line":598,"end_character":15},"updated":"2017-01-26 18:41:12.000000000","message":"+1 we weren\u0027t checking the exception in old code","commit_id":"83167caf8c9210e9b124e51f175ffad8d15a5418"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"46bebd9c8c7df7bdcdb00a357e973ad258412a20","unresolved":false,"context_lines":[{"line_number":593,"context_line":"                   flags\u003dflags)"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"    def get_memory(self):"},{"line_number":596,"context_line":"        try:"},{"line_number":597,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":598,"context_line":"        except Exception:"},{"line_number":599,"context_line":"            total \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_bf9458e2","line":596,"updated":"2017-01-26 19:36:25.000000000","message":"still useful to keep the comment about psutil returning a long?","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"},{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"d1097a8a44ac9cbc774ff14a86934255e422d5a2","unresolved":false,"context_lines":[{"line_number":593,"context_line":"                   flags\u003dflags)"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"    def get_memory(self):"},{"line_number":596,"context_line":"        try:"},{"line_number":597,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":598,"context_line":"        except Exception:"},{"line_number":599,"context_line":"            total \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_6a4a29ae","line":596,"in_reply_to":"3a461143_95369be5","updated":"2017-01-26 22:23:11.000000000","message":"this removal was unintentional, fixing","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"},{"author":{"_account_id":22860,"name":"Solio Sarabia","email":"solio.sarabia@intel.com","username":"ssarabia"},"change_message_id":"f7f4de2b128e97e6056ed3c9e2a30af0649ed115","unresolved":false,"context_lines":[{"line_number":593,"context_line":"                   flags\u003dflags)"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"    def get_memory(self):"},{"line_number":596,"context_line":"        try:"},{"line_number":597,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":598,"context_line":"        except Exception:"},{"line_number":599,"context_line":"            total \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_95369be5","line":596,"in_reply_to":"3a461143_bf9458e2","updated":"2017-01-26 19:59:10.000000000","message":"+1: Comment helps more than not.","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"0513b09524d8d4ba9442fbfe32bc5c25194118a1","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    def get_memory(self):"},{"line_number":596,"context_line":"        try:"},{"line_number":597,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":598,"context_line":"        except Exception:"},{"line_number":599,"context_line":"            total \u003d None"},{"line_number":600,"context_line":"            LOG.exception(\"Cannot fetch total memory size using psutil.\")"},{"line_number":601,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_5f4a8dc6","line":598,"updated":"2017-01-26 21:58:10.000000000","message":"Not a fan of Exception.\n\nCan this be a more granular exception? Or is there a reason to use Exception versus something more granular?","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"},{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"b7d54c57a05dd1172e2fc57a9b219d89f76b767b","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    def get_memory(self):"},{"line_number":596,"context_line":"        try:"},{"line_number":597,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":598,"context_line":"        except Exception:"},{"line_number":599,"context_line":"            total \u003d None"},{"line_number":600,"context_line":"            LOG.exception(\"Cannot fetch total memory size using psutil.\")"},{"line_number":601,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_aa85f159","line":598,"in_reply_to":"3a461143_5f4a8dc6","updated":"2017-01-26 22:00:26.000000000","message":"This is explicitly non-granular: I want to catch any situation where a newly upgraded psutil would fail, and instead print an error instead of blowing up the stack on IPA. I could potentially just make this AttributeError, which would catch some of the cases, but this is more about a statement of \"this psutil failing, in any way, shouldn\u0027t fail IPA startup + deployments\".","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"46bebd9c8c7df7bdcdb00a357e973ad258412a20","unresolved":false,"context_lines":[{"line_number":597,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":598,"context_line":"        except Exception:"},{"line_number":599,"context_line":"            total \u003d None"},{"line_number":600,"context_line":"            LOG.exception(\"Cannot fetch total memory size using psutil.\")"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"        try:"},{"line_number":603,"context_line":"            out, _e \u003d utils.execute(\"dmidecode --type 17 | grep Size\","}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_1ff2cc6f","line":600,"updated":"2017-01-26 19:36:25.000000000","message":"maybe useful to spit out the version of psutil? Will make it easier to debug when it goes to 9 :)","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"},{"author":{"_account_id":22860,"name":"Solio Sarabia","email":"solio.sarabia@intel.com","username":"ssarabia"},"change_message_id":"f7f4de2b128e97e6056ed3c9e2a30af0649ed115","unresolved":false,"context_lines":[{"line_number":597,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":598,"context_line":"        except Exception:"},{"line_number":599,"context_line":"            total \u003d None"},{"line_number":600,"context_line":"            LOG.exception(\"Cannot fetch total memory size using psutil.\")"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"        try:"},{"line_number":603,"context_line":"            out, _e \u003d utils.execute(\"dmidecode --type 17 | grep Size\","}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_f54d1f73","line":600,"in_reply_to":"3a461143_1ff2cc6f","updated":"2017-01-26 19:59:10.000000000","message":"+1","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"},{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"d1097a8a44ac9cbc774ff14a86934255e422d5a2","unresolved":false,"context_lines":[{"line_number":597,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":598,"context_line":"        except Exception:"},{"line_number":599,"context_line":"            total \u003d None"},{"line_number":600,"context_line":"            LOG.exception(\"Cannot fetch total memory size using psutil.\")"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"        try:"},{"line_number":603,"context_line":"            out, _e \u003d utils.execute(\"dmidecode --type 17 | grep Size\","}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_05b0b642","line":600,"in_reply_to":"3a461143_f54d1f73","updated":"2017-01-26 22:23:11.000000000","message":"Done","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"ff0f78185daf751935d97d50f76eb5d44ebb618c","unresolved":false,"context_lines":[{"line_number":596,"context_line":"        # psutil returns a long, so we force it to an int"},{"line_number":597,"context_line":"        try:"},{"line_number":598,"context_line":"            total \u003d int(psutil.virtual_memory().total)"},{"line_number":599,"context_line":"        except Exception:"},{"line_number":600,"context_line":"            total \u003d None"},{"line_number":601,"context_line":"            LOG.exception((\"Cannot fetch total memory size using psutil \""},{"line_number":602,"context_line":"                           \"version %s\"), psutil.version_info[0])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_857906ff","line":599,"updated":"2017-01-26 22:38:04.000000000","message":"nit: Maybe comment on the fact that this is on purpose a catch all exception because of the reasons stated.\n\nOnly if re-spin","commit_id":"b7ae4995a751084c200a33367df57c09c61bc439"},{"author":{"_account_id":22860,"name":"Solio Sarabia","email":"solio.sarabia@intel.com","username":"ssarabia"},"change_message_id":"79869ccfabd8009f90c80ea30b71d1ef6c645e52","unresolved":false,"context_lines":[{"line_number":599,"context_line":"        except Exception:"},{"line_number":600,"context_line":"            total \u003d None"},{"line_number":601,"context_line":"            LOG.exception((\"Cannot fetch total memory size using psutil \""},{"line_number":602,"context_line":"                           \"version %s\"), psutil.version_info[0])"},{"line_number":603,"context_line":""},{"line_number":604,"context_line":"        try:"},{"line_number":605,"context_line":"            out, _e \u003d utils.execute(\"dmidecode --type 17 | grep Size\","}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_65541a21","line":602,"range":{"start_line":602,"start_character":42,"end_line":602,"end_character":64},"updated":"2017-01-26 22:46:55.000000000","message":"the full version could also be useful, eg:\n\nstr(psutil.version_info)","commit_id":"b7ae4995a751084c200a33367df57c09c61bc439"}],"ironic_python_agent/tests/unit/test_hardware.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"16ce820fe2a1928df4ff92e494481fd3541651fc","unresolved":false,"context_lines":[{"line_number":771,"context_line":"        mem \u003d self.hardware.get_memory()"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"        self.assertEqual(3952 * 1024 * 1024, mem.total)"},{"line_number":774,"context_line":"        self.assertEqual(4096, mem.physical_mb)"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":"    @mock.patch(\u0027psutil.version_info\u0027, (99, 0))"},{"line_number":777,"context_line":"    @mock.patch.object(utils, \u0027execute\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_b8174e53","line":774,"updated":"2017-01-25 18:05:54.000000000","message":"For the above, I think we can use a helper method. Something like (i didn\u0027t try this so not totally sure)\n\n    @mock.patch.object(psutil, \u0027version_info\u0027)\n    @mock.patch.object(utils, \u0027execute\u0027)\n    def _test_get_memory_psutil(self, mocked_execute, mocked_version, version):\n        mocked_version.return_value \u003d (version, 0)\n        mocked_execute.return_value \u003d DMIDECODE_MEMORY_OUTPUT\n        mem \u003d self.hardware.get_memory()\n\n        self.assertEqual(3952 * 1024 * 1024, mem.total)\n        self.assertEqual(4096, mem.physical_mb)\n\n    @mock.patch(\u0027psutil.virtual_memory\u0027, create\u003dTrue)\n    def test_get_memory_psutil3_4_5(self, mocked_psutil):\n        mocked_psutil.return_value.total \u003d 3952 * 1024 * 1024\n        for v in range(3, 6):\n            self._test_get_memory_psutil(mocked_psutil, v)\n\netc","commit_id":"3ff61c9a453f75242fb9418f4ad9451bd57ccf66"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"136fba50ff586a4efd9081d54f7c25a788b0d75c","unresolved":false,"context_lines":[{"line_number":771,"context_line":"        mem \u003d self.hardware.get_memory()"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"        self.assertEqual(3952 * 1024 * 1024, mem.total)"},{"line_number":774,"context_line":"        self.assertEqual(4096, mem.physical_mb)"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":"    @mock.patch(\u0027psutil.version_info\u0027, (99, 0))"},{"line_number":777,"context_line":"    @mock.patch.object(utils, \u0027execute\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_67dd4270","line":774,"in_reply_to":"3a461143_7ee4ef0c","updated":"2017-01-25 19:04:21.000000000","message":"+1 to what rloo said, that way we test the actual paths for all the versions instead of a subset. Still leaving +1 since this is an improvement over what currently exists though","commit_id":"3ff61c9a453f75242fb9418f4ad9451bd57ccf66"},{"author":{"_account_id":22860,"name":"Solio Sarabia","email":"solio.sarabia@intel.com","username":"ssarabia"},"change_message_id":"80660872ad5b146551a93af105985956e3ac3d20","unresolved":false,"context_lines":[{"line_number":771,"context_line":"        mem \u003d self.hardware.get_memory()"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"        self.assertEqual(3952 * 1024 * 1024, mem.total)"},{"line_number":774,"context_line":"        self.assertEqual(4096, mem.physical_mb)"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":"    @mock.patch(\u0027psutil.version_info\u0027, (99, 0))"},{"line_number":777,"context_line":"    @mock.patch.object(utils, \u0027execute\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_7ee4ef0c","line":774,"in_reply_to":"3a461143_b8174e53","updated":"2017-01-25 18:16:30.000000000","message":"I think using psutil3 as method name is fine, instead of psutils3_4_5, considering long-term maintenance, when new psutil versions come along.","commit_id":"3ff61c9a453f75242fb9418f4ad9451bd57ccf66"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"0513b09524d8d4ba9442fbfe32bc5c25194118a1","unresolved":false,"context_lines":[{"line_number":748,"context_line":"        self.assertEqual(4096, mem.physical_mb)"},{"line_number":749,"context_line":""},{"line_number":750,"context_line":"    @mock.patch(\u0027psutil.virtual_memory\u0027, autospec\u003dTrue)"},{"line_number":751,"context_line":"    @mock.patch.object(utils, \u0027execute\u0027)"},{"line_number":752,"context_line":"    def test_get_memory_psutil_exception(self, mocked_execute, mocked_psutil):"},{"line_number":753,"context_line":"        mocked_execute.return_value \u003d DMIDECODE_MEMORY_OUTPUT"},{"line_number":754,"context_line":"        mocked_psutil.side_effect \u003d AttributeError()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a461143_9f8f9522","line":751,"updated":"2017-01-26 21:58:10.000000000","message":"nit: autospec\u003dTrue on this line?","commit_id":"4eb8b6030a5ce11c6320fc6698ff573b4adfcf3e"}]}
