)]}'
{"releasenotes/notes/get-usage-72d249ff790d1b8f.yaml":[{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"2c88a4edefa34db9ec157c47e49e12a003ab568f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Allow to retrieve the usage of a specific project"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"1a6eadb0_116376dd","line":3,"updated":"2016-12-20 18:11:54.000000000","message":"compute usage to be specific","commit_id":"633720cb9473d40795dfb5167a52f7aacddcf93b"}],"shade/operatorcloud.py":[{"author":{"_account_id":7350,"name":"Jordan Pittier","email":"jordan.pittier@gmail.com","username":"JordanP"},"change_message_id":"313069653b2d4861965183b3b80ce023f0da5034","unresolved":false,"context_lines":[{"line_number":2036,"context_line":"            return self.manager.submit_task("},{"line_number":2037,"context_line":"                _tasks.NovaUsageGet(tenant_id\u003dproj.id))"},{"line_number":2038,"context_line":"        except nova_exceptions.BadRequest:"},{"line_number":2039,"context_line":"            raise OpenStackCloudException(\"nova client call failed\")"},{"line_number":2040,"context_line":""},{"line_number":2041,"context_line":"    def set_volume_quotas(self, name_or_id, **kwargs):"},{"line_number":2042,"context_line":"        \"\"\" Set a volume quota in a project"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a629dbe_d6d79521","line":2039,"updated":"2016-11-07 12:18:31.000000000","message":"That error msg doesn\u0027t help. If I see this message in my production logs, I am gonna be \u0027which nova client call\u0027 ? \u0027Which tenant was queried\u0027 ?  \n\nAlso please use the with _utils.shade_exceptions context manager. Much more elegant. (see L1953)","commit_id":"7994718fe20f02aeb9f21d611b5e857e94bd7942"},{"author":{"_account_id":24162,"name":"Sorin Sbârnea","display_name":"zbr","email":"ssbarnea@redhat.com","username":"ssbarnea","status":"do not feed the troll 🥕"},"change_message_id":"3c854f9ff98586ca86d76488b0e5ebbb29383be3","unresolved":false,"context_lines":[{"line_number":2031,"context_line":"        \"\"\""},{"line_number":2032,"context_line":"        proj \u003d self.get_project(name_or_id)"},{"line_number":2033,"context_line":"        if not proj:"},{"line_number":2034,"context_line":"            raise OpenStackCloudException(\"project does not exist\")"},{"line_number":2035,"context_line":""},{"line_number":2036,"context_line":"        with _utils.shade_exceptions("},{"line_number":2037,"context_line":"                \"Unable to get resources usage for project: {name}\".format("}],"source_content_type":"text/x-python","patch_set":3,"id":"9a629dbe_ca3db8bc","line":2034,"updated":"2016-11-09 14:06:42.000000000","message":"How about something like:\n\"project does not exist: %s\" % name_or_id\n... just to make it easier to debug.","commit_id":"7d957b462759587eb411cf809267a03da205c60d"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"1fc5409c775a4b27ccb691c016d0615b0ef3013e","unresolved":false,"context_lines":[{"line_number":2032,"context_line":"        proj \u003d self.get_project(name_or_id)"},{"line_number":2033,"context_line":"        if not proj:"},{"line_number":2034,"context_line":"            raise OpenStackCloudException(\"project does not exist: {}\".format("},{"line_number":2035,"context_line":"                name\u003dproj))"},{"line_number":2036,"context_line":""},{"line_number":2037,"context_line":"        with _utils.shade_exceptions("},{"line_number":2038,"context_line":"                \"Unable to get resources usage for project: {name}\".format("}],"source_content_type":"text/x-python","patch_set":6,"id":"9a629dbe_6143b742","line":2035,"updated":"2016-11-10 15:43:38.000000000","message":"Do not print the entire \u0027proj\u0027 object. Just the name.","commit_id":"0d0305e3e61735ddf6fbda9b17d6e7f2d6205ac9"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"1fc5409c775a4b27ccb691c016d0615b0ef3013e","unresolved":false,"context_lines":[{"line_number":2036,"context_line":""},{"line_number":2037,"context_line":"        with _utils.shade_exceptions("},{"line_number":2038,"context_line":"                \"Unable to get resources usage for project: {name}\".format("},{"line_number":2039,"context_line":"                    name\u003dproj)):"},{"line_number":2040,"context_line":"            return self.manager.submit_task("},{"line_number":2041,"context_line":"                _tasks.NovaUsageGet(tenant_id\u003dproj.id))"},{"line_number":2042,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a629dbe_8167ebe7","line":2039,"updated":"2016-11-10 15:43:38.000000000","message":"Again, you need to grab the name from the project here.","commit_id":"0d0305e3e61735ddf6fbda9b17d6e7f2d6205ac9"}],"shade/tests/unit/test_usage.py":[{"author":{"_account_id":7350,"name":"Jordan Pittier","email":"jordan.pittier@gmail.com","username":"JordanP"},"change_message_id":"313069653b2d4861965183b3b80ce023f0da5034","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from shade.tests import fakes"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class TestUsage(base.TestCase):"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    @mock.patch.object(shade.OpenStackCloud, \u0027nova_client\u0027)"},{"line_number":24,"context_line":"    @mock.patch.object(shade.OpenStackCloud, \u0027keystone_client\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a629dbe_56e4650c","line":21,"updated":"2016-11-07 12:18:31.000000000","message":"You need another unit test that test when there\u0027s a failure (BadRequest is raised)","commit_id":"7994718fe20f02aeb9f21d611b5e857e94bd7942"},{"author":{"_account_id":16615,"name":"abregman","email":"abregman@redhat.com","username":"abregman"},"change_message_id":"a59fa0549ebc764bf661bbc38566b1d9247c01b0","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from shade.tests import fakes"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class TestUsage(base.TestCase):"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    @mock.patch.object(shade.OpenStackCloud, \u0027nova_client\u0027)"},{"line_number":24,"context_line":"    @mock.patch.object(shade.OpenStackCloud, \u0027keystone_client\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a629dbe_3d56bc29","line":21,"in_reply_to":"9a629dbe_42bc7105","updated":"2016-11-08 12:00:45.000000000","message":"I know what mocking is...but mock_nova.usage is not working as expected when trying to get usage data. have you tried it?\n\nAlso, can you answer on why there is no such check in test_get_quota?","commit_id":"7994718fe20f02aeb9f21d611b5e857e94bd7942"},{"author":{"_account_id":16615,"name":"abregman","email":"abregman@redhat.com","username":"abregman"},"change_message_id":"3bd06d4f8c72fede6606d6818ce53ff619459aef","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from shade.tests import fakes"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class TestUsage(base.TestCase):"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    @mock.patch.object(shade.OpenStackCloud, \u0027nova_client\u0027)"},{"line_number":24,"context_line":"    @mock.patch.object(shade.OpenStackCloud, \u0027keystone_client\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a629dbe_c717b34f","line":21,"in_reply_to":"9a629dbe_56e4650c","updated":"2016-11-08 11:21:37.000000000","message":"How to do that?\n\nIf I look on test_get_quota I dont see anything like that there","commit_id":"7994718fe20f02aeb9f21d611b5e857e94bd7942"},{"author":{"_account_id":7350,"name":"Jordan Pittier","email":"jordan.pittier@gmail.com","username":"JordanP"},"change_message_id":"a67a0675288f0bd636bc94ffdcc7e3c33f15ec82","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from shade.tests import fakes"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class TestUsage(base.TestCase):"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    @mock.patch.object(shade.OpenStackCloud, \u0027nova_client\u0027)"},{"line_number":24,"context_line":"    @mock.patch.object(shade.OpenStackCloud, \u0027keystone_client\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a629dbe_42bc7105","line":21,"in_reply_to":"9a629dbe_c717b34f","updated":"2016-11-08 11:25:50.000000000","message":"Add a new test and before your call to self.op_cloud.get_compute_usage(project) do something like\n\n  mock_nova.usage.get.side_effect \u003d nova_exceptions.BadRequest\n\nIt\u0027s called \"mocking\". Browse the test/units/ directory to see how it works. (grep for for \u0027side_effect\u0027)","commit_id":"7994718fe20f02aeb9f21d611b5e857e94bd7942"}]}
