)]}'
{"zun/scheduler/placement_client.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 Red Hat, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":5,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":6,"context_line":"#    a copy of the License at"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_0c87f95d","line":3,"range":{"start_line":1,"start_character":0,"end_line":3,"end_character":1},"updated":"2018-08-03 03:47:56.000000000","message":"Nit: the license is not correct.","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":17,"context_line":"import functools"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from keystoneauth1 import exceptions as ks_exc"},{"line_number":20,"context_line":"from keystoneauth1 import loading as keystone"},{"line_number":21,"context_line":"from oslo_log import log as logging"},{"line_number":22,"context_line":"from six.moves.urllib import parse"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_cc9ee167","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":45},"updated":"2018-08-03 03:47:56.000000000","message":"Nit: it is better to do this for consistency (because we are using this name in other places):\n\n  from keystoneauth1 import loading as ka_loading","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        except ks_exc.EndpointNotFound:"},{"line_number":47,"context_line":"            warn_limit("},{"line_number":48,"context_line":"                self,"},{"line_number":49,"context_line":"                _(\u0027The placement API endpoint not found. Placement is \u0027"},{"line_number":50,"context_line":"                  \u0027optional in Newton, but required in Ocata. Please \u0027"},{"line_number":51,"context_line":"                  \u0027enable the placement service before upgrading.\u0027))"},{"line_number":52,"context_line":"        except ks_exc.MissingAuthPlugin:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_0c6db966","line":49,"range":{"start_line":49,"start_character":16,"end_line":49,"end_character":18},"updated":"2018-08-03 03:47:56.000000000","message":"Translation is not needed for warning","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"026ac4c90982d383238e748ac5b17b86b3740319","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            warn_limit("},{"line_number":48,"context_line":"                self,"},{"line_number":49,"context_line":"                _(\u0027The placement API endpoint not found. Placement is \u0027"},{"line_number":50,"context_line":"                  \u0027optional in Newton, but required in Ocata. Please \u0027"},{"line_number":51,"context_line":"                  \u0027enable the placement service before upgrading.\u0027))"},{"line_number":52,"context_line":"        except ks_exc.MissingAuthPlugin:"},{"line_number":53,"context_line":"            warn_limit("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_49340348","line":50,"range":{"start_line":50,"start_character":19,"end_line":50,"end_character":60},"updated":"2018-08-03 02:55:16.000000000","message":"This needs to be rephrased for Zun.","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        except ks_exc.MissingAuthPlugin:"},{"line_number":53,"context_line":"            warn_limit("},{"line_number":54,"context_line":"                self,"},{"line_number":55,"context_line":"                _(\u0027No authentication information found for placement \u0027"},{"line_number":56,"context_line":"                  \u0027API. Placement is optional in Newton, but required \u0027"},{"line_number":57,"context_line":"                  \u0027in Ocata. Please enable the placement service \u0027"},{"line_number":58,"context_line":"                  \u0027before upgrading.\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_cc8ca12f","line":55,"range":{"start_line":55,"start_character":16,"end_line":55,"end_character":17},"updated":"2018-08-03 03:47:56.000000000","message":"Translation is not needed for warning","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"026ac4c90982d383238e748ac5b17b86b3740319","unresolved":false,"context_lines":[{"line_number":53,"context_line":"            warn_limit("},{"line_number":54,"context_line":"                self,"},{"line_number":55,"context_line":"                _(\u0027No authentication information found for placement \u0027"},{"line_number":56,"context_line":"                  \u0027API. Placement is optional in Newton, but required \u0027"},{"line_number":57,"context_line":"                  \u0027in Ocata. Please enable the placement service \u0027"},{"line_number":58,"context_line":"                  \u0027before upgrading.\u0027))"},{"line_number":59,"context_line":"        except ks_exc.Unauthorized:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_093e0b26","line":56,"range":{"start_line":56,"start_character":34,"end_line":56,"end_character":69},"updated":"2018-08-03 02:55:16.000000000","message":"Ditto","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        except ks_exc.Unauthorized:"},{"line_number":60,"context_line":"            warn_limit("},{"line_number":61,"context_line":"                self,"},{"line_number":62,"context_line":"                _(\u0027Placement service credentials do not work. \u0027"},{"line_number":63,"context_line":"                  \u0027Placement is optional in Newton, but required \u0027"},{"line_number":64,"context_line":"                  \u0027in Ocata. Please enable the placement service \u0027"},{"line_number":65,"context_line":"                  \u0027before upgrading.\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_6c91cd45","line":62,"range":{"start_line":62,"start_character":16,"end_line":62,"end_character":17},"updated":"2018-08-03 03:47:56.000000000","message":"Translation is not needed for warning","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"026ac4c90982d383238e748ac5b17b86b3740319","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            warn_limit("},{"line_number":61,"context_line":"                self,"},{"line_number":62,"context_line":"                _(\u0027Placement service credentials do not work. \u0027"},{"line_number":63,"context_line":"                  \u0027Placement is optional in Newton, but required \u0027"},{"line_number":64,"context_line":"                  \u0027in Ocata. Please enable the placement service \u0027"},{"line_number":65,"context_line":"                  \u0027before upgrading.\u0027))"},{"line_number":66,"context_line":"        except ks_exc.DiscoveryFailure:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_a90cb796","line":63,"range":{"start_line":63,"start_character":32,"end_line":63,"end_character":64},"updated":"2018-08-03 02:55:16.000000000","message":"Ditto","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":68,"context_line":"            # exception here. In Pike we should take care about keystoneauth1"},{"line_number":69,"context_line":"            # failures handling globally."},{"line_number":70,"context_line":"            warn_limit(self,"},{"line_number":71,"context_line":"                       _(\u0027Discovering suitable URL for placement API \u0027"},{"line_number":72,"context_line":"                         \u0027failed.\u0027))"},{"line_number":73,"context_line":"        except ks_exc.ConnectFailure:"},{"line_number":74,"context_line":"            msg \u003d _(\u0027Placement API service is not responding.\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_8c96a93d","line":71,"range":{"start_line":71,"start_character":23,"end_line":71,"end_character":24},"updated":"2018-08-03 03:47:56.000000000","message":"Translation is not needed for warning","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                       _(\u0027Discovering suitable URL for placement API \u0027"},{"line_number":72,"context_line":"                         \u0027failed.\u0027))"},{"line_number":73,"context_line":"        except ks_exc.ConnectFailure:"},{"line_number":74,"context_line":"            msg \u003d _(\u0027Placement API service is not responding.\u0027)"},{"line_number":75,"context_line":"            LOG.warning(msg)"},{"line_number":76,"context_line":"    return wrapper"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_2c9bd565","line":74,"range":{"start_line":74,"start_character":18,"end_line":74,"end_character":19},"updated":"2018-08-03 03:47:56.000000000","message":"Translation is not needed for warning","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # A dict, keyed by the resource provider UUID, of ResourceProvider"},{"line_number":168,"context_line":"        # objects that will have their inventories and allocations tracked by"},{"line_number":169,"context_line":"        # the placement API for the compute host"},{"line_number":170,"context_line":"        self._resource_providers \u003d {}"},{"line_number":171,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":172,"context_line":"        # the provider is associated with"},{"line_number":173,"context_line":"        self._provider_aggregate_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_0cda99e5","line":170,"range":{"start_line":170,"start_character":13,"end_line":170,"end_character":32},"updated":"2018-08-03 03:47:56.000000000","message":"This one is unused?","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        self._resource_providers \u003d {}"},{"line_number":171,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":172,"context_line":"        # the provider is associated with"},{"line_number":173,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":174,"context_line":"        # A dict, keyed by resource provider UUID, of sets of traits UUIDs"},{"line_number":175,"context_line":"        # the provider is associated with"},{"line_number":176,"context_line":"        self._provider_traits_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_ace8457e","line":173,"range":{"start_line":173,"start_character":13,"end_line":173,"end_character":36},"updated":"2018-08-03 03:47:56.000000000","message":"This one is unused?","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":174,"context_line":"        # A dict, keyed by resource provider UUID, of sets of traits UUIDs"},{"line_number":175,"context_line":"        # the provider is associated with"},{"line_number":176,"context_line":"        self._provider_traits_map \u003d {}"},{"line_number":177,"context_line":"        auth_plugin \u003d keystone.load_auth_from_conf_options("},{"line_number":178,"context_line":"            CONF, \u0027placement\u0027)"},{"line_number":179,"context_line":"        self._client \u003d keystone.load_session_from_conf_options("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_ec6e3d2c","line":176,"range":{"start_line":176,"start_character":13,"end_line":176,"end_character":33},"updated":"2018-08-03 03:47:56.000000000","message":"This one is unused?","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"026ac4c90982d383238e748ac5b17b86b3740319","unresolved":false,"context_lines":[{"line_number":330,"context_line":"    @safe_connect"},{"line_number":331,"context_line":"    def claim_resources(self, consumer_uuid, alloc_request, project_id,"},{"line_number":332,"context_line":"                        user_id, attempt\u003d0):"},{"line_number":333,"context_line":"        \"\"\"Creates allocation records for the supplied instance UUID."},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"        We check to see if resources have already been claimed for this"},{"line_number":336,"context_line":"        consumer. If so, we assume that a move operation is underway and the"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_0c593928","line":333,"range":{"start_line":333,"start_character":55,"end_line":333,"end_character":63},"updated":"2018-08-03 02:55:16.000000000","message":"container","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"026ac4c90982d383238e748ac5b17b86b3740319","unresolved":false,"context_lines":[{"line_number":357,"context_line":"        \"\"\""},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        # Ensure we don\u0027t change the supplied alloc request since it\u0027s used in"},{"line_number":360,"context_line":"        # a loop within the scheduler against multiple instance claims"},{"line_number":361,"context_line":"        ar \u003d copy.deepcopy(alloc_request)"},{"line_number":362,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % consumer_uuid"},{"line_number":363,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_cc9821cd","line":360,"range":{"start_line":360,"start_character":55,"end_line":360,"end_character":63},"updated":"2018-08-03 02:55:16.000000000","message":"container","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"026ac4c90982d383238e748ac5b17b86b3740319","unresolved":false,"context_lines":[{"line_number":394,"context_line":"              reality, this will change to allocate against multiple providers."},{"line_number":395,"context_line":""},{"line_number":396,"context_line":"        :param rp_uuid: The UUID of the resource provider to allocate against."},{"line_number":397,"context_line":"        :param consumer_uuid: The instance\u0027s UUID."},{"line_number":398,"context_line":"        :param alloc_data: Dict, keyed by resource class, of amounts to"},{"line_number":399,"context_line":"                           consume."},{"line_number":400,"context_line":"        :param project_id: The project_id associated with the allocations."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_2ca7550d","line":397,"range":{"start_line":397,"start_character":34,"end_line":397,"end_character":42},"updated":"2018-08-03 02:55:16.000000000","message":"container","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"641c5e36e17d5f50ba260bff5f041a91b839df3a","unresolved":false,"context_lines":[{"line_number":433,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":434,"context_line":""},{"line_number":435,"context_line":"    @safe_connect"},{"line_number":436,"context_line":"    def delete_allocation_for_instance(self, uuid):"},{"line_number":437,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % uuid"},{"line_number":438,"context_line":"        r \u003d self.delete(url)"},{"line_number":439,"context_line":"        if r:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_cc9261fc","line":436,"range":{"start_line":436,"start_character":8,"end_line":436,"end_character":38},"updated":"2018-08-03 03:47:56.000000000","message":"for_container","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"026ac4c90982d383238e748ac5b17b86b3740319","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % uuid"},{"line_number":438,"context_line":"        r \u003d self.delete(url)"},{"line_number":439,"context_line":"        if r:"},{"line_number":440,"context_line":"            LOG.info(\u0027Deleted allocation for instance %s\u0027, uuid)"},{"line_number":441,"context_line":"        else:"},{"line_number":442,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":443,"context_line":"            # delete something which doesn\u0027t actually exist."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_ac7cc574","line":440,"range":{"start_line":440,"start_character":45,"end_line":440,"end_character":53},"updated":"2018-08-03 02:55:16.000000000","message":"container","commit_id":"d014a15abd82e80a44d10a9c48082fbe6dceab9a"}]}
