)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e6af7a2961f1182d778abdb1dd02039c2fa9f67e","unresolved":false,"context_lines":[{"line_number":13,"context_line":"we call the placement REST API each time _ensure_resource_provider() is"},{"line_number":14,"context_line":"called. The alternative to this is to require operators to restart their"},{"line_number":15,"context_line":"nova-compute workers in order to have aggregate information picked up"},{"line_number":16,"context_line":"when providers are associated with aggregates."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I8474d4d7a46c8bc42eb6e97c2403e2bd7716012e"},{"line_number":19,"context_line":"blueprint: generic-resource-pools-ocata"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a71b18c_d600b968","line":16,"updated":"2016-12-06 11:40:15.000000000","message":"If the efficiency of the requests is a concern[1] (either with regard to delay here, or load on the api server) we should consider using standard cache handling on both the client and server sides including some or all of the following\n\n* memcached (or other) in front of the server\u0027s database\n* memcached (or other) in front of the server\u0027s serialization handling\n* etags and other cache control headers on responses\n* something like https://pypi.python.org/pypi/CacheControl/ on the requests session in the client\n\n[1] but that would be early optimization","commit_id":"00bd2818c3e04ed1c3cfe4bb97c78fc93d03ea8b"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e6af7a2961f1182d778abdb1dd02039c2fa9f67e","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                     value"},{"line_number":254,"context_line":"        \"\"\""},{"line_number":255,"context_line":"        if uuid in self._resource_providers:"},{"line_number":256,"context_line":"            return self._resource_providers[uuid]"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        rp \u003d self._get_resource_provider(uuid)"},{"line_number":259,"context_line":"        if rp is None:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_567ca9b4","side":"PARENT","line":256,"updated":"2016-12-06 11:40:15.000000000","message":"Is it worth doing the _get_provider_aggregates call in only one place?\n\n    rp \u003d self._resource_providers.get(uuid, self._get_resource_provider(uuid))\n    if rp is None:\n        [same]\n    # get aggs\n    # set rp dict (sometimes redundantly)\n    # set agg dict\n    return rp","commit_id":"deab36be524cbb5a8a1329f6ae7421e94c549ad3"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"e4a76fadd84a33f9288798835008617f8f4d74bd","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        elif resp.status_code \u003d\u003d 404:"},{"line_number":183,"context_line":"            msg \u003d _LW(\"Tried to get a provider\u0027s aggregates however the \""},{"line_number":184,"context_line":"                      \"provider %s does not exist.\")"},{"line_number":185,"context_line":"            LOG.warn(msg, rp_uuid)"},{"line_number":186,"context_line":"        else:"},{"line_number":187,"context_line":"            msg \u003d _LE(\"Failed to retrieve aggregates from placement API \""},{"line_number":188,"context_line":"                      \"for resource provider with UUID %(uuid)s. \""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_a91f6259","line":185,"range":{"start_line":185,"start_character":12,"end_line":185,"end_character":34},"updated":"2016-12-06 11:44:14.000000000","message":"Flake8 complains about this line (for some reason there is no pep8 gate failure though), to use LOG.warning() instead of warn()","commit_id":"00bd2818c3e04ed1c3cfe4bb97c78fc93d03ea8b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e6af7a2961f1182d778abdb1dd02039c2fa9f67e","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                \u0027status_code\u0027: resp.status_code,"},{"line_number":193,"context_line":"                \u0027err_text\u0027: resp.text,"},{"line_number":194,"context_line":"            }"},{"line_number":195,"context_line":"            LOG.error(msg, args)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    @safe_connect"},{"line_number":198,"context_line":"    def _get_resource_provider(self, uuid):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_f670550d","line":195,"updated":"2016-12-06 11:40:15.000000000","message":"Are we okay with implicit returns? I\u0027d vote for having a return None last line.","commit_id":"00bd2818c3e04ed1c3cfe4bb97c78fc93d03ea8b"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"e4a76fadd84a33f9288798835008617f8f4d74bd","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                \u0027status_code\u0027: resp.status_code,"},{"line_number":193,"context_line":"                \u0027err_text\u0027: resp.text,"},{"line_number":194,"context_line":"            }"},{"line_number":195,"context_line":"            LOG.error(msg, args)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    @safe_connect"},{"line_number":198,"context_line":"    def _get_resource_provider(self, uuid):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_a97be279","line":195,"in_reply_to":"3a71b18c_f670550d","updated":"2016-12-06 11:44:14.000000000","message":"Yeah, let\u0027s be explicit.","commit_id":"00bd2818c3e04ed1c3cfe4bb97c78fc93d03ea8b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1c0a580b9339fbdbb584ca0831d8cd5e115ddf40","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        auth_plugin \u003d keystone.load_auth_from_conf_options("},{"line_number":130,"context_line":"            CONF, \u0027placement\u0027)"},{"line_number":131,"context_line":"        headers \u003d {"},{"line_number":132,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027,"},{"line_number":133,"context_line":"        }"},{"line_number":134,"context_line":"        self._client \u003d session.Session("},{"line_number":135,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a6eadb0_0f039410","line":132,"updated":"2016-12-19 15:58:09.000000000","message":"I like using latest here, but it does seem to run a bit contrary to the explicitness desired by the microversion concept. Should we lock this to the version that provides the desired functionality and then only raise it when one of the two becomes true:\n\n* we add functionality only provided by a newer version\n* we lower the min\n\n?","commit_id":"70996b70c75cb2efbfa221fd3596ffc86f3744fe"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3c790a2abcbe9f56286a6de6111f39488f8dd846","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        auth_plugin \u003d keystone.load_auth_from_conf_options("},{"line_number":130,"context_line":"            CONF, \u0027placement\u0027)"},{"line_number":131,"context_line":"        headers \u003d {"},{"line_number":132,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027,"},{"line_number":133,"context_line":"        }"},{"line_number":134,"context_line":"        self._client \u003d session.Session("},{"line_number":135,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a6eadb0_4993c7fa","line":132,"in_reply_to":"1a6eadb0_0f039410","updated":"2016-12-19 16:50:59.000000000","message":"Sure, I could do that... either way I guess :) I originally had it as a specific version and then changed it to latest after going through rebase hell ;)","commit_id":"70996b70c75cb2efbfa221fd3596ffc86f3744fe"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1c0a580b9339fbdbb584ca0831d8cd5e115ddf40","unresolved":false,"context_lines":[{"line_number":308,"context_line":"            rp \u003d self._create_resource_provider(uuid, name)"},{"line_number":309,"context_line":"            if rp is None:"},{"line_number":310,"context_line":"                return"},{"line_number":311,"context_line":"        msg \u003d \"Grabbing aggregate associations for resource provider %s\""},{"line_number":312,"context_line":"        LOG.debug(msg, uuid)"},{"line_number":313,"context_line":"        aggs \u003d self._get_provider_aggregates(uuid)"},{"line_number":314,"context_line":"        self._resource_providers[uuid] \u003d rp"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a6eadb0_afaf002a","line":311,"updated":"2016-12-19 15:58:09.000000000","message":"Do we care that grabbing is rather informal?","commit_id":"70996b70c75cb2efbfa221fd3596ffc86f3744fe"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"1826493b3e4e3acd5aff1a9a810f9461d708d8df","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            data \u003d resp.json()"},{"line_number":181,"context_line":"            return set(data[\u0027aggregates\u0027])"},{"line_number":182,"context_line":"        elif resp.status_code \u003d\u003d 404:"},{"line_number":183,"context_line":"            msg \u003d _LW(\"Tried to get a provider\u0027s aggregates however the \""},{"line_number":184,"context_line":"                      \"provider %s does not exist.\")"},{"line_number":185,"context_line":"            LOG.warning(msg, rp_uuid)"},{"line_number":186,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba5201f7_2d66032a","line":183,"range":{"start_line":183,"start_character":59,"end_line":183,"end_character":60},"updated":"2017-01-06 15:42:17.000000000","message":"micro-grammar-nazi-nit: there should be a semicolon between the two clauses.","commit_id":"9821b8ba8a7ddae9a42344958c1d711f7baeea8b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0ff8b38f89861a300269882495c9e356584efaf7","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            data \u003d resp.json()"},{"line_number":181,"context_line":"            return set(data[\u0027aggregates\u0027])"},{"line_number":182,"context_line":"        elif resp.status_code \u003d\u003d 404:"},{"line_number":183,"context_line":"            msg \u003d _LW(\"Tried to get a provider\u0027s aggregates however the \""},{"line_number":184,"context_line":"                      \"provider %s does not exist.\")"},{"line_number":185,"context_line":"            LOG.warning(msg, rp_uuid)"},{"line_number":186,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba5201f7_af7a2086","line":183,"range":{"start_line":183,"start_character":59,"end_line":183,"end_character":60},"in_reply_to":"ba5201f7_2d66032a","updated":"2017-01-11 22:28:05.000000000","message":"Done","commit_id":"9821b8ba8a7ddae9a42344958c1d711f7baeea8b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"40a84ffb4c0b25e49a9eeefd64e7434b0dd2a6fd","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":171,"context_line":"        self._warn_count \u003d 0"},{"line_number":172,"context_line":"        headers \u003d {"},{"line_number":173,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027,"},{"line_number":174,"context_line":"        }"},{"line_number":175,"context_line":"        self._client \u003d session.Session("},{"line_number":176,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a3c09a3_cb003104","line":173,"range":{"start_line":173,"start_character":48,"end_line":173,"end_character":54},"updated":"2017-01-17 12:12:46.000000000","message":"I think this is a bad idea from the client side. The client should request the latest version it knows how to handle, in this case 1.1. We don\u0027t want the client requesting latest in Ocata and then let\u0027s say in Pike something goes into the placement API which changes the request or response format on something and now this Ocata client is busted.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"cbaa8c180292f11a613d6c55622b70e13e07080a","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":171,"context_line":"        self._warn_count \u003d 0"},{"line_number":172,"context_line":"        headers \u003d {"},{"line_number":173,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027,"},{"line_number":174,"context_line":"        }"},{"line_number":175,"context_line":"        self._client \u003d session.Session("},{"line_number":176,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a3905b3_8914e8f5","line":173,"range":{"start_line":173,"start_character":48,"end_line":173,"end_character":54},"in_reply_to":"5a3905b3_a5b9d2eb","updated":"2017-01-19 17:16:31.000000000","message":"I was not planning on adding any functionality to turn off the aggregate checking if the placement API didn\u0027t support 1.1, no.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"cf70feb682fc0abfe4953c7a45a66fd402fdf100","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":171,"context_line":"        self._warn_count \u003d 0"},{"line_number":172,"context_line":"        headers \u003d {"},{"line_number":173,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027,"},{"line_number":174,"context_line":"        }"},{"line_number":175,"context_line":"        self._client \u003d session.Session("},{"line_number":176,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a3905b3_06ae2c85","line":173,"range":{"start_line":173,"start_character":48,"end_line":173,"end_character":54},"in_reply_to":"7a3c09a3_576f822a","updated":"2017-01-19 15:55:56.000000000","message":"Done","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c25d16898db6212125ef4209a134b0dd4ec7a3e2","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":171,"context_line":"        self._warn_count \u003d 0"},{"line_number":172,"context_line":"        headers \u003d {"},{"line_number":173,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027,"},{"line_number":174,"context_line":"        }"},{"line_number":175,"context_line":"        self._client \u003d session.Session("},{"line_number":176,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a3905b3_a5b9d2eb","line":173,"range":{"start_line":173,"start_character":48,"end_line":173,"end_character":54},"in_reply_to":"7a3c09a3_576f822a","updated":"2017-01-19 15:09:08.000000000","message":"It looks like you can pass the headers kwarg to session.get:\n\nhttps://github.com/openstack/keystoneauth/blob/master/keystoneauth1/session.py#L485\n\nAnd that\u0027s how we can request the 1.1 microversion for aggregates. The question I have is version discovery - are we going to check for the minimum available up front, or are we just going to request 1.1 and if that\u0027s not available we handle it gracefully but you don\u0027t have aggregates (log a warning of course).","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0a73d3f5a5518771a3dc251a43e02f57e9d10c18","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":171,"context_line":"        self._warn_count \u003d 0"},{"line_number":172,"context_line":"        headers \u003d {"},{"line_number":173,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027,"},{"line_number":174,"context_line":"        }"},{"line_number":175,"context_line":"        self._client \u003d session.Session("},{"line_number":176,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a3c09a3_576f822a","line":173,"range":{"start_line":173,"start_character":48,"end_line":173,"end_character":54},"in_reply_to":"7a3c09a3_cb003104","updated":"2017-01-17 14:10:55.000000000","message":"Agreed, this was simply an oversight. In recent patches, we\u0027ve changed this to specify a particular microversion.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"9922b5259d34fd6d89ce7a13fc113fe456e17b73","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if resp.status_code \u003d\u003d 200:"},{"line_number":218,"context_line":"            data \u003d resp.json()"},{"line_number":219,"context_line":"            return set(data[\u0027aggregates\u0027])"},{"line_number":220,"context_line":"        elif resp.status_code \u003d\u003d 404:"},{"line_number":221,"context_line":"            msg \u003d _LW(\"Tried to get a provider\u0027s aggregates; however the \""},{"line_number":222,"context_line":"                      \"provider %s does not exist.\")"},{"line_number":223,"context_line":"            LOG.warning(msg, rp_uuid)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a57fde8_cfdc5d49","line":220,"range":{"start_line":220,"start_character":8,"end_line":220,"end_character":12},"updated":"2017-01-12 07:30:52.000000000","message":"just if","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"cf70feb682fc0abfe4953c7a45a66fd402fdf100","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if resp.status_code \u003d\u003d 200:"},{"line_number":218,"context_line":"            data \u003d resp.json()"},{"line_number":219,"context_line":"            return set(data[\u0027aggregates\u0027])"},{"line_number":220,"context_line":"        elif resp.status_code \u003d\u003d 404:"},{"line_number":221,"context_line":"            msg \u003d _LW(\"Tried to get a provider\u0027s aggregates; however the \""},{"line_number":222,"context_line":"                      \"provider %s does not exist.\")"},{"line_number":223,"context_line":"            LOG.warning(msg, rp_uuid)"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a3905b3_a6b558ce","line":220,"range":{"start_line":220,"start_character":8,"end_line":220,"end_character":12},"in_reply_to":"9a57fde8_cfdc5d49","updated":"2017-01-19 15:55:56.000000000","message":"Done","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6efa67b72f2488274507f5560e45cb7ded9c64d4","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            data \u003d resp.json()"},{"line_number":219,"context_line":"            return set(data[\u0027aggregates\u0027])"},{"line_number":220,"context_line":"        elif resp.status_code \u003d\u003d 404:"},{"line_number":221,"context_line":"            msg \u003d _LW(\"Tried to get a provider\u0027s aggregates; however the \""},{"line_number":222,"context_line":"                      \"provider %s does not exist.\")"},{"line_number":223,"context_line":"            LOG.warning(msg, rp_uuid)"},{"line_number":224,"context_line":"        else:"},{"line_number":225,"context_line":"            msg \u003d _LE(\"Failed to retrieve aggregates from placement API \""},{"line_number":226,"context_line":"                      \"for resource provider with UUID %(uuid)s. \""}],"source_content_type":"text/x-python","patch_set":13,"id":"7a3c09a3_eba7adba","line":223,"range":{"start_line":221,"start_character":12,"end_line":223,"end_character":37},"updated":"2017-01-17 12:25:16.000000000","message":"This is only true if the 404 is for the resource provider not existing. You can also get a 404 if you\u0027re requesting microversion 1.1 but that\u0027s not available. I think we should probably build some version discovery into the report client such that we know the max_version available early and can key off that, i.e. if we know we can\u0027t request 1.1 then we don\u0027t even attempt to set/get aggregates, and we continue to use 1.0. With what you have in this change, we\u0027re always requesting \u003e1.0 and if that\u0027s not available, not only will this aggregates stuff not work, but nothing else will either.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"cf70feb682fc0abfe4953c7a45a66fd402fdf100","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            data \u003d resp.json()"},{"line_number":219,"context_line":"            return set(data[\u0027aggregates\u0027])"},{"line_number":220,"context_line":"        elif resp.status_code \u003d\u003d 404:"},{"line_number":221,"context_line":"            msg \u003d _LW(\"Tried to get a provider\u0027s aggregates; however the \""},{"line_number":222,"context_line":"                      \"provider %s does not exist.\")"},{"line_number":223,"context_line":"            LOG.warning(msg, rp_uuid)"},{"line_number":224,"context_line":"        else:"},{"line_number":225,"context_line":"            msg \u003d _LE(\"Failed to retrieve aggregates from placement API \""},{"line_number":226,"context_line":"                      \"for resource provider with UUID %(uuid)s. \""}],"source_content_type":"text/x-python","patch_set":13,"id":"5a3905b3_8635bc47","line":223,"range":{"start_line":221,"start_character":12,"end_line":223,"end_character":37},"in_reply_to":"7a3c09a3_eba7adba","updated":"2017-01-19 15:55:56.000000000","message":"I\u0027m OK building this version discovery and \"self-healing\" stuff into future patches. Doing that all in this patch I think is a little much.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6efa67b72f2488274507f5560e45cb7ded9c64d4","unresolved":false,"context_lines":[{"line_number":327,"context_line":"                     value"},{"line_number":328,"context_line":"        \"\"\""},{"line_number":329,"context_line":"        if uuid in self._resource_providers:"},{"line_number":330,"context_line":"            # NOTE(jaypipes): This isn\u0027t optimal to check if aggregate"},{"line_number":331,"context_line":"            # associations have changed each time we call"},{"line_number":332,"context_line":"            # _ensure_resource_provider() and get a hit on the local cache of"},{"line_number":333,"context_line":"            # provider objects, however the alternative is to force operators"},{"line_number":334,"context_line":"            # to restart all their nova-compute workers every time they add or"},{"line_number":335,"context_line":"            # change an aggregate. We might optionally want to add some sort of"},{"line_number":336,"context_line":"            # cache refresh delay or interval as an optimization?"},{"line_number":337,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":338,"context_line":"            LOG.debug(msg, uuid)"},{"line_number":339,"context_line":"            aggs \u003d self._get_provider_aggregates(uuid)"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a3c09a3_6bf73d8b","line":336,"range":{"start_line":330,"start_character":12,"end_line":336,"end_character":65},"updated":"2017-01-17 12:25:16.000000000","message":"See comment about this in update_resource_stats.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6efa67b72f2488274507f5560e45cb7ded9c64d4","unresolved":false,"context_lines":[{"line_number":337,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":338,"context_line":"            LOG.debug(msg, uuid)"},{"line_number":339,"context_line":"            aggs \u003d self._get_provider_aggregates(uuid)"},{"line_number":340,"context_line":"            self._provider_aggregate_map[uuid] \u003d aggs"},{"line_number":341,"context_line":"            return self._resource_providers[uuid]"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        rp \u003d self._get_resource_provider(uuid)"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a3c09a3_4b4d213d","line":340,"range":{"start_line":340,"start_character":12,"end_line":340,"end_character":53},"updated":"2017-01-17 12:25:16.000000000","message":"Is there any reason we don\u0027t want to simply update the cache within _get_provider_aggregates if the GET is successful? I guess updating the cache outside the getter method makes the getter method consistent with the others in here, like for getting resource providers and inventories.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"cf70feb682fc0abfe4953c7a45a66fd402fdf100","unresolved":false,"context_lines":[{"line_number":337,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":338,"context_line":"            LOG.debug(msg, uuid)"},{"line_number":339,"context_line":"            aggs \u003d self._get_provider_aggregates(uuid)"},{"line_number":340,"context_line":"            self._provider_aggregate_map[uuid] \u003d aggs"},{"line_number":341,"context_line":"            return self._resource_providers[uuid]"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        rp \u003d self._get_resource_provider(uuid)"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a3905b3_264c08c7","line":340,"range":{"start_line":340,"start_character":12,"end_line":340,"end_character":53},"in_reply_to":"7a3c09a3_4b4d213d","updated":"2017-01-19 15:55:56.000000000","message":"Yes, that, and also I would still need to change the create_resource_provider() method to set the agg cache as well (as I do below in line 351). I preferred to do that only in a single method... this one.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6efa67b72f2488274507f5560e45cb7ded9c64d4","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        :param compute_node: updated nova.objects.ComputeNode to report"},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        compute_node.save()"},{"line_number":526,"context_line":"        self._ensure_resource_provider(compute_node.uuid,"},{"line_number":527,"context_line":"                                       compute_node.hypervisor_hostname)"},{"line_number":528,"context_line":"        inv_data \u003d _compute_node_to_inventory_dict(compute_node)"},{"line_number":529,"context_line":"        if inv_data:"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a3c09a3_2bb375ea","line":526,"range":{"start_line":526,"start_character":13,"end_line":526,"end_character":38},"updated":"2017-01-17 12:25:16.000000000","message":"So we\u0027re going to refresh the aggregate cache here.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6efa67b72f2488274507f5560e45cb7ded9c64d4","unresolved":false,"context_lines":[{"line_number":527,"context_line":"                                       compute_node.hypervisor_hostname)"},{"line_number":528,"context_line":"        inv_data \u003d _compute_node_to_inventory_dict(compute_node)"},{"line_number":529,"context_line":"        if inv_data:"},{"line_number":530,"context_line":"            self._update_inventory(compute_node.uuid, inv_data)"},{"line_number":531,"context_line":"        else:"},{"line_number":532,"context_line":"            self._delete_inventory(compute_node.uuid)"},{"line_number":533,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7a3c09a3_eb0a4d89","line":530,"range":{"start_line":530,"start_character":17,"end_line":530,"end_character":34},"updated":"2017-01-17 12:25:16.000000000","message":"And eventually again from here.\n\nSince update_resource_stats is called from the resource tracker when things change (or we hit the update_available_resources periodic task in the compute manager), should we just do our aggregate update cache in the first call to _ensure_resource_provider? i.e. have a flag on that to tell if it it should refresh aggregates, and we pass True in the first call in this method, and False from _update_inventory_attempt.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"cf70feb682fc0abfe4953c7a45a66fd402fdf100","unresolved":false,"context_lines":[{"line_number":527,"context_line":"                                       compute_node.hypervisor_hostname)"},{"line_number":528,"context_line":"        inv_data \u003d _compute_node_to_inventory_dict(compute_node)"},{"line_number":529,"context_line":"        if inv_data:"},{"line_number":530,"context_line":"            self._update_inventory(compute_node.uuid, inv_data)"},{"line_number":531,"context_line":"        else:"},{"line_number":532,"context_line":"            self._delete_inventory(compute_node.uuid)"},{"line_number":533,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"5a3905b3_a672b8e3","line":530,"range":{"start_line":530,"start_character":17,"end_line":530,"end_character":34},"in_reply_to":"7a3c09a3_eb0a4d89","updated":"2017-01-19 15:55:56.000000000","message":"The issue with doing that is that the compute node will not be responsive to an admin associated an aggregate to a compute node after the compute node starts. This (granted, very inefficient) mechanism for refreshing the aggregate cache is so that the admin doesn\u0027t need to restart compute nodes to get the reporting client to pick up changes to a computenode\u0027s aggregate assocaitions.","commit_id":"bc84aa3535533d3939ddce9fddd0a3f7cf5c05ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"af33dede12fb215f6a7215372e63316c69d3a0cc","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":171,"context_line":"        self._warn_count \u003d 0"},{"line_number":172,"context_line":"        headers \u003d {"},{"line_number":173,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement 1.1\u0027,"},{"line_number":174,"context_line":"        }"},{"line_number":175,"context_line":"        self._client \u003d session.Session("},{"line_number":176,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a3905b3_7a3685e8","line":173,"updated":"2017-01-20 03:27:26.000000000","message":"We didn\u0027t have 1.1 in Newton so if placement isn\u0027t updated yet this is going to make all computes fail (if the computes have this code). That would technically mean that either placement isn\u0027t rolled out yet, or it\u0027s newton and someone started upgrading their computes to ocata first, which would be wrong.\n\nHowever, we have the retry thing in case you have ocata computes but placement isn\u0027t rolled out yet so the computes will keep trying to connect until placement is available. This would break that because safe_connect() is going to not handle the 400 error that this is going to start returning in that case.\n\nSo rather than doing this globally, can we just do it in the _get_provider_aggregates method when making the get() request? We should be able to plumb through the \"headers\" kwarg to the keystoneauth1 Session.get() method with the microversion we need for that specific GET request and if that fails, then oh well, at least it doesn\u0027t break everything else in here.","commit_id":"fddde7c82ab457fdd057da15a6f95ba40f9b77ff"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6a8d3548afd6e06b609b64e988d1ab04ea56bdce","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":171,"context_line":"        self._warn_count \u003d 0"},{"line_number":172,"context_line":"        headers \u003d {"},{"line_number":173,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement 1.1\u0027,"},{"line_number":174,"context_line":"        }"},{"line_number":175,"context_line":"        self._client \u003d session.Session("},{"line_number":176,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a3905b3_dab699db","line":173,"in_reply_to":"5a3905b3_7a3685e8","updated":"2017-01-20 03:33:19.000000000","message":"Correction on the above, this wouldn\u0027t break safe_connect because if we make a safe connection and make the request, that\u0027s fine, it\u0027s just that everything would start getting 400s back instead of possible successful requests for things that work with 1.0. So you might get most things working if placement isn\u0027t new enough except aggregates vs nothing working if you don\u0027t have 1.1.","commit_id":"fddde7c82ab457fdd057da15a6f95ba40f9b77ff"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b6800b14eb06f974fc9010007c759af85b156dc3","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        :param rp_uuid: UUID of the resource provider to grab aggregates for."},{"line_number":217,"context_line":"        \"\"\""},{"line_number":218,"context_line":"        resp \u003d self.get(\"/resource_providers/%s/aggregates\" % rp_uuid,"},{"line_number":219,"context_line":"                        version\u003d\u00271.1\u0027)"},{"line_number":220,"context_line":"        if resp.status_code \u003d\u003d 200:"},{"line_number":221,"context_line":"            data \u003d resp.json()"},{"line_number":222,"context_line":"            return set(data[\u0027aggregates\u0027])"}],"source_content_type":"text/x-python","patch_set":16,"id":"5a3905b3_c198571e","line":219,"updated":"2017-01-20 13:37:09.000000000","message":"I guess this is one of those places we hard depend on an upgrade placement API. Maybe thats OK, maybe its not, but this is consistent.","commit_id":"7d04c78c1e2c26125eff5b1a8543b1ac5d027107"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b6800b14eb06f974fc9010007c759af85b156dc3","unresolved":false,"context_lines":[{"line_number":336,"context_line":"            # provider objects, however the alternative is to force operators"},{"line_number":337,"context_line":"            # to restart all their nova-compute workers every time they add or"},{"line_number":338,"context_line":"            # change an aggregate. We might optionally want to add some sort of"},{"line_number":339,"context_line":"            # cache refresh delay or interval as an optimization?"},{"line_number":340,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":341,"context_line":"            LOG.debug(msg, uuid)"},{"line_number":342,"context_line":"            aggs \u003d self._get_provider_aggregates(uuid)"}],"source_content_type":"text/x-python","patch_set":16,"id":"5a3905b3_a1c7cb10","line":339,"range":{"start_line":339,"start_character":14,"end_line":339,"end_character":65},"updated":"2017-01-20 13:37:09.000000000","message":"+1 that idea. Seems to match other things we do.","commit_id":"7d04c78c1e2c26125eff5b1a8543b1ac5d027107"}],"nova/tests/functional/api/openstack/placement/test_report_client.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"1826493b3e4e3acd5aff1a9a810f9461d708d8df","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        request_session \u003d requests.Session()"},{"line_number":41,"context_line":"        headers \u003d {"},{"line_number":42,"context_line":"            \u0027x-auth-token\u0027: \u0027admin\u0027,"},{"line_number":43,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027"},{"line_number":44,"context_line":"        }"},{"line_number":45,"context_line":"        self._client \u003d session.Session("},{"line_number":46,"context_line":"            auth\u003dNone,"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba5201f7_b06b26b6","line":43,"updated":"2017-01-06 15:42:17.000000000","message":"Only if you respin: add a comma at the end of the line to minimize future diffs.","commit_id":"9821b8ba8a7ddae9a42344958c1d711f7baeea8b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0ff8b38f89861a300269882495c9e356584efaf7","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        request_session \u003d requests.Session()"},{"line_number":41,"context_line":"        headers \u003d {"},{"line_number":42,"context_line":"            \u0027x-auth-token\u0027: \u0027admin\u0027,"},{"line_number":43,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027"},{"line_number":44,"context_line":"        }"},{"line_number":45,"context_line":"        self._client \u003d session.Session("},{"line_number":46,"context_line":"            auth\u003dNone,"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba5201f7_af886072","line":43,"in_reply_to":"ba5201f7_b06b26b6","updated":"2017-01-11 22:28:05.000000000","message":"Done","commit_id":"9821b8ba8a7ddae9a42344958c1d711f7baeea8b"}]}
