)]}'
{"nova/api/openstack/compute/hypervisors.py":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"2d574e84ef567608c779343d3587b303261e4f96","unresolved":true,"context_lines":[{"line_number":197,"context_line":"        if not context.can(hv_policies.BASE_POLICY_NAME % \u0027list\u0027, fatal\u003dFalse):"},{"line_number":198,"context_line":"            project_id \u003d context.project_id"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"            # TODO(stephenfin): Do this in SQL"},{"line_number":201,"context_line":"            hosts \u003d set()"},{"line_number":202,"context_line":"            for aggregate in objects.Aggregate.get_by_metadata("},{"line_number":203,"context_line":"                context, \u0027filter_tenant_id\u0027,"},{"line_number":204,"context_line":"            ):"},{"line_number":205,"context_line":"                if project_id in aggregate.metadata[\u0027filter_tenant_id\u0027]:"},{"line_number":206,"context_line":"                    hosts.update(aggregate.hosts)"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"            # no matching hosts"},{"line_number":209,"context_line":"            if not hosts:"},{"line_number":210,"context_line":"                return {}"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"            compute_nodes \u003d [cn for cn in compute_nodes if cn.host in hosts]"},{"line_number":213,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"483ec23a_25bce353","line":210,"range":{"start_line":200,"start_character":0,"end_line":210,"end_character":25},"updated":"2021-03-10 14:48:05.000000000","message":"we also need to handle if host in aggregate with no filter_tenant_id metadata then it allow all projects to create instance so in that case we need to return that set of host(s) for project admin.\n\nhttps://github.com/openstack/nova/blob/0e7cd9d1a95a30455e3c91916ece590454235e0e/nova/scheduler/filters/aggregate_multitenancy_isolation.py#L54","commit_id":"5245553909d289f4a19c6dfe627aea4846285962"}],"nova/policies/hypervisors.py":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"e26d90e7dec1d09f46f0e6dcaaad74f6073e8833","unresolved":true,"context_lines":[{"line_number":34,"context_line":"hypervisors_policies \u003d ["},{"line_number":35,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":36,"context_line":"        name\u003dBASE_POLICY_NAME % \u0027list\u0027,"},{"line_number":37,"context_line":"        check_str\u003dbase.PROJECT_ADMIN_OR_SYSTEM_READER,"},{"line_number":38,"context_line":"        description\u003d\"List all hypervisors.\","},{"line_number":39,"context_line":"        operations\u003d["},{"line_number":40,"context_line":"            {"}],"source_content_type":"text/x-python","patch_set":3,"id":"9087ec71_1ac5711f","line":37,"range":{"start_line":37,"start_character":23,"end_line":37,"end_character":36},"updated":"2021-01-06 22:13:58.000000000","message":"can you add new tests also https://github.com/openstack/nova/blob/master/nova/tests/unit/policies/test_hypervisors.py","commit_id":"dd11cd6a9282536e9419c0b4de738441cbfddd2b"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"19bbe46733b8f361639634b1cb0458ead1bb3bfa","unresolved":false,"context_lines":[{"line_number":34,"context_line":"hypervisors_policies \u003d ["},{"line_number":35,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":36,"context_line":"        name\u003dBASE_POLICY_NAME % \u0027list\u0027,"},{"line_number":37,"context_line":"        check_str\u003dbase.PROJECT_ADMIN_OR_SYSTEM_READER,"},{"line_number":38,"context_line":"        description\u003d\"List all hypervisors.\","},{"line_number":39,"context_line":"        operations\u003d["},{"line_number":40,"context_line":"            {"}],"source_content_type":"text/x-python","patch_set":3,"id":"16f360c7_1c894caf","line":37,"range":{"start_line":37,"start_character":23,"end_line":37,"end_character":36},"in_reply_to":"9087ec71_1ac5711f","updated":"2021-03-08 21:51:41.000000000","message":"Done","commit_id":"dd11cd6a9282536e9419c0b4de738441cbfddd2b"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"e26d90e7dec1d09f46f0e6dcaaad74f6073e8833","unresolved":true,"context_lines":[{"line_number":42,"context_line":"                \u0027method\u0027: \u0027GET\u0027"},{"line_number":43,"context_line":"            },"},{"line_number":44,"context_line":"        ],"},{"line_number":45,"context_line":"        scope_types\u003d[\u0027system\u0027],"},{"line_number":46,"context_line":"        deprecated_rule\u003dDEPRECATED_POLICY,"},{"line_number":47,"context_line":"        deprecated_reason\u003dDEPRECATED_REASON,"},{"line_number":48,"context_line":"        deprecated_since\u003d\u002721.0.0\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"54f7b389_1eb105e2","line":45,"range":{"start_line":45,"start_character":20,"end_line":45,"end_character":31},"updated":"2021-01-06 22:13:58.000000000","message":"we need to scope it to both so that project admin token can pass the scope checks. \n[\u0027system\u0027, \u0027project\u0027],\n\nwith that change HypervisorsScopeTypePolicyTest should fail and need self.project_admin_context to be moved in self.reader_authorized_contexts \n - https://github.com/openstack/nova/blob/master/nova/tests/unit/policies/test_hypervisors.py#L127\n\nother modification required in test is here (base_policy.SYSTEM_READER -\u003e base_policy.PROJECT_ADMIN_OR_SYSTEM_READER) - https://github.com/openstack/nova/blob/master/nova/tests/unit/policies/test_hypervisors.py#L148","commit_id":"dd11cd6a9282536e9419c0b4de738441cbfddd2b"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"19bbe46733b8f361639634b1cb0458ead1bb3bfa","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                \u0027method\u0027: \u0027GET\u0027"},{"line_number":43,"context_line":"            },"},{"line_number":44,"context_line":"        ],"},{"line_number":45,"context_line":"        scope_types\u003d[\u0027system\u0027],"},{"line_number":46,"context_line":"        deprecated_rule\u003dDEPRECATED_POLICY,"},{"line_number":47,"context_line":"        deprecated_reason\u003dDEPRECATED_REASON,"},{"line_number":48,"context_line":"        deprecated_since\u003d\u002721.0.0\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"31137c57_3e0da77a","line":45,"range":{"start_line":45,"start_character":20,"end_line":45,"end_character":31},"in_reply_to":"54f7b389_1eb105e2","updated":"2021-03-08 21:51:41.000000000","message":"Done","commit_id":"dd11cd6a9282536e9419c0b4de738441cbfddd2b"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"e26d90e7dec1d09f46f0e6dcaaad74f6073e8833","unresolved":true,"context_lines":[{"line_number":43,"context_line":"            },"},{"line_number":44,"context_line":"        ],"},{"line_number":45,"context_line":"        scope_types\u003d[\u0027system\u0027],"},{"line_number":46,"context_line":"        deprecated_rule\u003dDEPRECATED_POLICY,"},{"line_number":47,"context_line":"        deprecated_reason\u003dDEPRECATED_REASON,"},{"line_number":48,"context_line":"        deprecated_since\u003d\u002721.0.0\u0027),"},{"line_number":49,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":50,"context_line":"        name\u003dBASE_POLICY_NAME % \u0027list-detail\u0027,"},{"line_number":51,"context_line":"        check_str\u003dbase.SYSTEM_READER,"}],"source_content_type":"text/x-python","patch_set":3,"id":"bfd35bd1_a1061f8e","line":48,"range":{"start_line":46,"start_character":0,"end_line":48,"end_character":35},"updated":"2021-01-06 22:13:58.000000000","message":"we already have old legacy policy as deprecated_rule so old token will keep working here.","commit_id":"dd11cd6a9282536e9419c0b4de738441cbfddd2b"}]}
