)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f919bb2d2a9fbcc6e1e41985ef010eea8d899635","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2015-07-29 02:07:04 +0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix forming a message for the exception raised if port limit is hit"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Ia64ea9919bd7495e31084b0c4a0b173153564585"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9a1a9d01_e29ea562","line":8,"updated":"2015-10-02 15:10:26.000000000","message":"Should have:\n\nCloses-Bug: #1477316","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"22be312d1a221f2206a7110f412e5cb772e3c2b2","unresolved":false,"context_lines":[{"line_number":1124,"context_line":"                             \"is over the limit: %(quota)d\") %"},{"line_number":1125,"context_line":"                           {\u0027ports\u0027: len(ports),"},{"line_number":1126,"context_line":"                            \u0027quota\u0027: quotas.get(\u0027port\u0027)})"},{"line_number":1127,"context_line":"                    raise exception.PortLimitExceeded(msg)"},{"line_number":1128,"context_line":"                ports_needed \u003d ports_needed_per_instance * num_instances"},{"line_number":1129,"context_line":"                if free_ports \u003e\u003d ports_needed:"},{"line_number":1130,"context_line":"                    return num_instances"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_7c227903","line":1127,"updated":"2015-07-23 19:46:49.000000000","message":"Obviously this case is not unit tested, can you please add a unit test to cover this case?","commit_id":"815dd4022292979320d600de8bffe3b705c268c4"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"2bc077ed3ab474f7dcaf532ddd17cf622dac297f","unresolved":false,"context_lines":[{"line_number":1124,"context_line":"                             \"is over the limit: %(quota)d\") %"},{"line_number":1125,"context_line":"                           {\u0027ports\u0027: len(ports),"},{"line_number":1126,"context_line":"                            \u0027quota\u0027: quotas.get(\u0027port\u0027)})"},{"line_number":1127,"context_line":"                    raise exception.PortLimitExceeded(msg)"},{"line_number":1128,"context_line":"                ports_needed \u003d ports_needed_per_instance * num_instances"},{"line_number":1129,"context_line":"                if free_ports \u003e\u003d ports_needed:"},{"line_number":1130,"context_line":"                    return num_instances"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_d03dacde","line":1127,"in_reply_to":"3a50d1a3_7c227903","updated":"2015-07-30 00:50:07.000000000","message":"Done","commit_id":"815dd4022292979320d600de8bffe3b705c268c4"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"b85566d4acf5f61d67d35b35151819117a870ce6","unresolved":false,"context_lines":[{"line_number":1477,"context_line":"            tenant_id\u003d\u0027my_tenantid\u0027).AndReturn("},{"line_number":1478,"context_line":"                    {\u0027quota\u0027: {\u0027port\u0027: 0}})"},{"line_number":1479,"context_line":"        self.mox.ReplayAll()"},{"line_number":1480,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1481,"context_line":"        try:"},{"line_number":1482,"context_line":"            api.validate_networks(self.context, requested_networks, 1)"},{"line_number":1483,"context_line":"        except exception.PortLimitExceeded as ex:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_f20ea58b","line":1480,"updated":"2015-07-30 07:47:31.000000000","message":"please use mock for new test","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"60062b7514f9c1c51aa6b7f951ed1a687f77998e","unresolved":false,"context_lines":[{"line_number":1477,"context_line":"            tenant_id\u003d\u0027my_tenantid\u0027).AndReturn("},{"line_number":1478,"context_line":"                    {\u0027quota\u0027: {\u0027port\u0027: 0}})"},{"line_number":1479,"context_line":"        self.mox.ReplayAll()"},{"line_number":1480,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1481,"context_line":"        try:"},{"line_number":1482,"context_line":"            api.validate_networks(self.context, requested_networks, 1)"},{"line_number":1483,"context_line":"        except exception.PortLimitExceeded as ex:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_aecf5956","line":1480,"in_reply_to":"3a50d1a3_68714844","updated":"2015-07-30 08:27:48.000000000","message":"if you write new cases, use mock instead of mox should be thought about, I can\u0027t find the original guideline...","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7408949319fd48553543d82c9e09ff37bd09eff1","unresolved":false,"context_lines":[{"line_number":1477,"context_line":"            tenant_id\u003d\u0027my_tenantid\u0027).AndReturn("},{"line_number":1478,"context_line":"                    {\u0027quota\u0027: {\u0027port\u0027: 0}})"},{"line_number":1479,"context_line":"        self.mox.ReplayAll()"},{"line_number":1480,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1481,"context_line":"        try:"},{"line_number":1482,"context_line":"            api.validate_networks(self.context, requested_networks, 1)"},{"line_number":1483,"context_line":"        except exception.PortLimitExceeded as ex:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_f5a8b679","line":1480,"in_reply_to":"3a50d1a3_aecf5956","updated":"2015-07-30 16:04:15.000000000","message":"Yeah, ideally new tests go under TestNeutronv2WithMock so we can use mock rather than the terrible horrible setUp that happens for this test class with all of the moxed out stuff - it\u0027s super rigid and hard to follow the setup and how things are tested, new straight-forward tests with mock are much clearer since they don\u0027t have all of that global setup which sometimes has to be undone to make the tests work properly.","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"3c6d3edcd1baf641cbed957dc73aef315c0dcbf8","unresolved":false,"context_lines":[{"line_number":1477,"context_line":"            tenant_id\u003d\u0027my_tenantid\u0027).AndReturn("},{"line_number":1478,"context_line":"                    {\u0027quota\u0027: {\u0027port\u0027: 0}})"},{"line_number":1479,"context_line":"        self.mox.ReplayAll()"},{"line_number":1480,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1481,"context_line":"        try:"},{"line_number":1482,"context_line":"            api.validate_networks(self.context, requested_networks, 1)"},{"line_number":1483,"context_line":"        except exception.PortLimitExceeded as ex:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_68714844","line":1480,"in_reply_to":"3a50d1a3_f20ea58b","updated":"2015-07-30 08:15:27.000000000","message":"Not sure I get your point. Could you please explain?","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"53ea3b9d45c965ebbd36009e083672497c055d76","unresolved":false,"context_lines":[{"line_number":1477,"context_line":"            tenant_id\u003d\u0027my_tenantid\u0027).AndReturn("},{"line_number":1478,"context_line":"                    {\u0027quota\u0027: {\u0027port\u0027: 0}})"},{"line_number":1479,"context_line":"        self.mox.ReplayAll()"},{"line_number":1480,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1481,"context_line":"        try:"},{"line_number":1482,"context_line":"            api.validate_networks(self.context, requested_networks, 1)"},{"line_number":1483,"context_line":"        except exception.PortLimitExceeded as ex:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_b229cff4","line":1480,"in_reply_to":"3a50d1a3_f5a8b679","updated":"2015-07-31 01:48:55.000000000","message":"Done","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"b85566d4acf5f61d67d35b35151819117a870ce6","unresolved":false,"context_lines":[{"line_number":1480,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1481,"context_line":"        try:"},{"line_number":1482,"context_line":"            api.validate_networks(self.context, requested_networks, 1)"},{"line_number":1483,"context_line":"        except exception.PortLimitExceeded as ex:"},{"line_number":1484,"context_line":"            self.assertIn(\u0027The number of defined ports: 1\u0027, ex.message)"},{"line_number":1485,"context_line":""},{"line_number":1486,"context_line":"    def test_validate_networks_ex_1(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_521e79bc","line":1483,"updated":"2015-07-30 07:47:31.000000000","message":"can we use assertRaise (exception.PortLimitExceeded ...) and check the exception message?","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"3c6d3edcd1baf641cbed957dc73aef315c0dcbf8","unresolved":false,"context_lines":[{"line_number":1480,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1481,"context_line":"        try:"},{"line_number":1482,"context_line":"            api.validate_networks(self.context, requested_networks, 1)"},{"line_number":1483,"context_line":"        except exception.PortLimitExceeded as ex:"},{"line_number":1484,"context_line":"            self.assertIn(\u0027The number of defined ports: 1\u0027, ex.message)"},{"line_number":1485,"context_line":""},{"line_number":1486,"context_line":"    def test_validate_networks_ex_1(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_a84f50bd","line":1483,"in_reply_to":"3a50d1a3_521e79bc","updated":"2015-07-30 08:15:27.000000000","message":"i\u0027ve written it this way specifically to check exception message","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"53ea3b9d45c965ebbd36009e083672497c055d76","unresolved":false,"context_lines":[{"line_number":1480,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1481,"context_line":"        try:"},{"line_number":1482,"context_line":"            api.validate_networks(self.context, requested_networks, 1)"},{"line_number":1483,"context_line":"        except exception.PortLimitExceeded as ex:"},{"line_number":1484,"context_line":"            self.assertIn(\u0027The number of defined ports: 1\u0027, ex.message)"},{"line_number":1485,"context_line":""},{"line_number":1486,"context_line":"    def test_validate_networks_ex_1(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_f2f0b793","line":1483,"in_reply_to":"3a50d1a3_55e5ead9","updated":"2015-07-31 01:48:55.000000000","message":"ok, got you, thanks","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"60062b7514f9c1c51aa6b7f951ed1a687f77998e","unresolved":false,"context_lines":[{"line_number":1480,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1481,"context_line":"        try:"},{"line_number":1482,"context_line":"            api.validate_networks(self.context, requested_networks, 1)"},{"line_number":1483,"context_line":"        except exception.PortLimitExceeded as ex:"},{"line_number":1484,"context_line":"            self.assertIn(\u0027The number of defined ports: 1\u0027, ex.message)"},{"line_number":1485,"context_line":""},{"line_number":1486,"context_line":"    def test_validate_networks_ex_1(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_cecc2564","line":1483,"in_reply_to":"3a50d1a3_a84f50bd","updated":"2015-07-30 08:27:48.000000000","message":"https://github.com/openstack/nova/blob/master/nova/tests/unit/virt/xenapi/test_xenapi.py#L3189\n\nmaybe a reference..","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7408949319fd48553543d82c9e09ff37bd09eff1","unresolved":false,"context_lines":[{"line_number":1480,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1481,"context_line":"        try:"},{"line_number":1482,"context_line":"            api.validate_networks(self.context, requested_networks, 1)"},{"line_number":1483,"context_line":"        except exception.PortLimitExceeded as ex:"},{"line_number":1484,"context_line":"            self.assertIn(\u0027The number of defined ports: 1\u0027, ex.message)"},{"line_number":1485,"context_line":""},{"line_number":1486,"context_line":"    def test_validate_networks_ex_1(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_55e5ead9","line":1483,"in_reply_to":"3a50d1a3_cecc2564","updated":"2015-07-30 16:04:15.000000000","message":"self.assertRaises actually returns the exception that was caught, so you can check the message on it that way.\n\nex \u003d self.assertRaises(...)\n\nself.assertIn(\u0027The number of defined ports: 1\u0027, ex.message)","commit_id":"a1a89ec69bd792bf2c59834cf1deada8da826e87"}]}
