)]}'
{"openstack_dashboard/dashboards/project/floating_ips/tests.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"f45dbda2cb25fceaa103076b1e437c49134417f7","unresolved":false,"context_lines":[{"line_number":365,"context_line":"                        api.base: (\u0027is_service_enabled\u0027,),"},{"line_number":366,"context_line":"                        api.cinder: (\u0027is_volume_service_enabled\u0027,)})"},{"line_number":367,"context_line":"    @test.update_settings(OPENSTACK_NEUTRON_NETWORK\u003d{\u0027enable_quotas\u0027: True})"},{"line_number":368,"context_line":"    def test_correct_quotas_displayed_shared_networks(self):"},{"line_number":369,"context_line":"        api.cinder.is_volume_service_enabled(IsA(http.HttpRequest)) \\"},{"line_number":370,"context_line":"            .AndReturn(False)"},{"line_number":371,"context_line":"        api.base.is_service_enabled(IsA(http.HttpRequest), \u0027network\u0027) \\"}],"source_content_type":"text/x-python","patch_set":14,"id":"df140735_130d3f8f","line":368,"range":{"start_line":368,"start_character":4,"end_line":368,"end_character":60},"updated":"2017-06-05 09:18:09.000000000","message":"This test was removed by another patch, This needs to be dropped because this test is exactly same as the previous one now.","commit_id":"a278706fc784728e83768ec9c2ff965550665e0e"}],"openstack_dashboard/dashboards/project/instances/workflows/create_instance.py":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"9bf73c832cf42530ff0595898810f37ab09f08c8","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        # Prevent launching more instances than the quota allows"},{"line_number":210,"context_line":"        usages \u003d quotas.tenant_quota_usages("},{"line_number":211,"context_line":"            self.request,"},{"line_number":212,"context_line":"            targets\u003d[\u0027instances\u0027, \u0027cores\u0027, \u0027ram\u0027, \u0027volumes\u0027])"},{"line_number":213,"context_line":"        available_count \u003d usages[\u0027instances\u0027][\u0027available\u0027]"},{"line_number":214,"context_line":"        if available_count \u003c count:"},{"line_number":215,"context_line":"            msg \u003d (_(\u0027The requested instance(s) cannot be launched \u0027"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff0f0b1f_8492e74a","line":212,"updated":"2017-05-25 20:01:20.000000000","message":"nit: we can check for source_type here and do not request volume quotas if the are not required","commit_id":"af85ab41a9a34a12b991d6bf22cc4e7299fcb839"}],"openstack_dashboard/usage/quotas.py":[{"author":{"_account_id":6825,"name":"Gary W. Smith","email":"garysmith123@gmail.com","username":"gary-w-smith"},"change_message_id":"d0a168971bcea34efc506edd17b43795e1741004","unresolved":false,"context_lines":[{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"def _convert_targets_to_quota_keys(targets):"},{"line_number":441,"context_line":"    quota_keys \u003d []"},{"line_number":442,"context_line":"    for target in targets:"},{"line_number":443,"context_line":"        if target in NETWORK_QUOTA_API_KEY_MAP:"},{"line_number":444,"context_line":"            quota_keys +\u003d NETWORK_QUOTA_API_KEY_MAP[target]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7ffa3b31_f4e7bc11","line":441,"updated":"2017-04-18 21:00:50.000000000","message":"Since this function is returning a set, it would be more straightforward to just define quota_keys as a set and use set functions to add elements.\nIn the same way, it would be nice if all of this files\u0027 *FIELDS variables were sets instead of tuples since they are all being manipulated as sets, but that\u0027s beyond the scope of this change.","commit_id":"d5c6a1e5ab2336a0f3714045654047f101bd1f59"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6e045d8c40be9d920ac190b07c230c83900ba2d7","unresolved":false,"context_lines":[{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"def _convert_targets_to_quota_keys(targets):"},{"line_number":441,"context_line":"    quota_keys \u003d []"},{"line_number":442,"context_line":"    for target in targets:"},{"line_number":443,"context_line":"        if target in NETWORK_QUOTA_API_KEY_MAP:"},{"line_number":444,"context_line":"            quota_keys +\u003d NETWORK_QUOTA_API_KEY_MAP[target]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7ffa3b31_ab2547c4","line":441,"in_reply_to":"7ffa3b31_e8d115cf","updated":"2017-04-19 07:15:41.000000000","message":"I converted all of this files\u0027 *FIELDS variables into a set in the parent patch. The change is small and I believe it is worth changed in this patch series.","commit_id":"d5c6a1e5ab2336a0f3714045654047f101bd1f59"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1e419d19bed128f84225d25838a52699fb93ff6b","unresolved":false,"context_lines":[{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"def _convert_targets_to_quota_keys(targets):"},{"line_number":441,"context_line":"    quota_keys \u003d []"},{"line_number":442,"context_line":"    for target in targets:"},{"line_number":443,"context_line":"        if target in NETWORK_QUOTA_API_KEY_MAP:"},{"line_number":444,"context_line":"            quota_keys +\u003d NETWORK_QUOTA_API_KEY_MAP[target]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7ffa3b31_e8d115cf","line":441,"in_reply_to":"7ffa3b31_f4e7bc11","updated":"2017-04-19 06:24:57.000000000","message":"Reasonable comment and I totally agree with you. I changed quota_keys to a set.\n\nFor other *FIELDS, I will check it can be converted into a set with reasonable size of diff in the parent patch.","commit_id":"d5c6a1e5ab2336a0f3714045654047f101bd1f59"},{"author":{"_account_id":12826,"name":"Rob Cresswell","display_name":"robcresswell","email":"robert.cresswell@outlook.com","username":"rob-cresswell"},"change_message_id":"2d54a9ada6157be9d8ac9eda8f5296cf944335b1","unresolved":false,"context_lines":[{"line_number":427,"context_line":"            singular_name \u003d target[:-1]"},{"line_number":428,"context_line":"            if singular_name in NEUTRON_QUOTA_FIELDS:"},{"line_number":429,"context_line":"                quota_keys.add(singular_name)"},{"line_number":430,"context_line":"                continue"},{"line_number":431,"context_line":"        if target in QUOTA_FIELDS:"},{"line_number":432,"context_line":"            quota_keys.add(target)"},{"line_number":433,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff0f0b1f_d0011d3a","line":430,"updated":"2017-05-23 11:59:57.000000000","message":"This logic confuses me a bit. Why is it required? Could we not just pass the correct form that the is in NEUTRON_QUOTA_FIELDS, instead of making assumptions about pluralisation etc? It seems like a lot of logic; I would prefer we just use the back end quota names like \"router\" rather than trying to handle \"routers\"","commit_id":"b0fe55ac941c3016da048b75d5a2fc0fc475608e"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"511af5ad6be379b7b13bacc775698d4fcd329aae","unresolved":false,"context_lines":[{"line_number":427,"context_line":"            singular_name \u003d target[:-1]"},{"line_number":428,"context_line":"            if singular_name in NEUTRON_QUOTA_FIELDS:"},{"line_number":429,"context_line":"                quota_keys.add(singular_name)"},{"line_number":430,"context_line":"                continue"},{"line_number":431,"context_line":"        if target in QUOTA_FIELDS:"},{"line_number":432,"context_line":"            quota_keys.add(target)"},{"line_number":433,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff0f0b1f_f9e870b3","line":430,"in_reply_to":"ff0f0b1f_d0011d3a","updated":"2017-05-24 05:28:55.000000000","message":"Okay. On a second thought, I agree your idea makes the logic much simpler. At first, I thought it is better to use key names (plural form) used for quota keys, but it makes things complicated. I will update the code.\n\nIdeally this kind of things is handled in the APi wrapper layer. It may be improved as part of the quota work. At now, we can use the backend quota names directly. It is acceptable to me too. Thanks.","commit_id":"b0fe55ac941c3016da048b75d5a2fc0fc475608e"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7fb0a65dcd1f0cb54b4695e0eb5ce279ecfb87bb","unresolved":false,"context_lines":[{"line_number":427,"context_line":"            singular_name \u003d target[:-1]"},{"line_number":428,"context_line":"            if singular_name in NEUTRON_QUOTA_FIELDS:"},{"line_number":429,"context_line":"                quota_keys.add(singular_name)"},{"line_number":430,"context_line":"                continue"},{"line_number":431,"context_line":"        if target in QUOTA_FIELDS:"},{"line_number":432,"context_line":"            quota_keys.add(target)"},{"line_number":433,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff0f0b1f_19b7a488","line":430,"in_reply_to":"ff0f0b1f_f9e870b3","updated":"2017-05-24 05:44:35.000000000","message":"Hmm.... I encounter another problem when changing the code.\n\nIf we drop the logic here, we will need another mapping in a caller side. An example is [1]. If we get network quota and usage, the code would be like:\n\n  usages \u003d quotas.tenant_quota_usages(request, targets\u003d[\u0027network\u0027])\n  available \u003d usages.get(\u0027networks\u0027, {}).get(\u0027available\u0027, 1)\n\nWe need to specify \u0027network\u0027 but \u0027networks\u0027 is used in a return value. It is tricky.\n\nNow I am thinking to add \u0027network\u0027, \u0027subnet\u0027, \u0027port\u0027 and \u0027router\u0027 to NETWORK_QUOTA_API_KEY_MAP (L.413).\n\nThought?\n\n[1] https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/network_topology/utils.py#L20-L23","commit_id":"b0fe55ac941c3016da048b75d5a2fc0fc475608e"}]}
