)]}'
{"glance_store/_drivers/swift/store.py":[{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"c4768124efbfb146ca05b07ed51e056e3413a7c1","unresolved":false,"context_lines":[{"line_number":769,"context_line":""},{"line_number":770,"context_line":"        if not (self.auth_address and self.user and self.key):"},{"line_number":771,"context_line":"            reason \u003d _(\"A value for auth_address, user and key is required. \""},{"line_number":772,"context_line":"                       \"In the glance-swift-store.conf.\")"},{"line_number":773,"context_line":"            LOG.error(reason)"},{"line_number":774,"context_line":"            raise exceptions.BadStoreConfiguration(message\u003dreason)"},{"line_number":775,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_eddb5b7a","line":772,"updated":"2015-10-22 15:59:16.000000000","message":"glance-swift-store.conf: this file name is not hardcoded, it is configurable, so we can\u0027t print out a hardcoded value.","commit_id":"40c5876c4c322801a875652bc768e37b3745ce41"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"c4768124efbfb146ca05b07ed51e056e3413a7c1","unresolved":false,"context_lines":[{"line_number":827,"context_line":""},{"line_number":828,"context_line":"    def _get_auth_version(self, auth_url):"},{"line_number":829,"context_line":"        try:"},{"line_number":830,"context_line":"            version_string \u003d auth_url.rsplit(\"/\", 2)[-2]"},{"line_number":831,"context_line":""},{"line_number":832,"context_line":"            if version_string[0] !\u003d \u0027v\u0027:"},{"line_number":833,"context_line":"                return 0"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_ed491b32","line":830,"updated":"2015-10-22 15:59:16.000000000","message":"This doesn\u0027t look very robust. Would using urlparse be an idea?","commit_id":"40c5876c4c322801a875652bc768e37b3745ce41"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"c4768124efbfb146ca05b07ed51e056e3413a7c1","unresolved":false,"context_lines":[{"line_number":857,"context_line":"        else:"},{"line_number":858,"context_line":"            tenant_name \u003d None"},{"line_number":859,"context_line":"            user \u003d location.user"},{"line_number":860,"context_line":""},{"line_number":861,"context_line":"        # Get auth version from URI if the old style"},{"line_number":862,"context_line":"        if location.uri_contain_location:"},{"line_number":863,"context_line":"            self.auth_version \u003d self._get_auth_version("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_39b50e7d","line":860,"updated":"2015-10-22 15:59:16.000000000","message":"Adding the auth_version into the location class may be a bit neater.","commit_id":"40c5876c4c322801a875652bc768e37b3745ce41"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"b582847fa0e81fc93ca060dab752f2649443c713","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            store \u003d self.conf.glance_store.default_swift_reference"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"            return \u0027%s://%s/%s/%s\u0027 % (\u0027swift+config\u0027, store, container, obj)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        if self.scheme \u003d\u003d \u0027swift+config\u0027:"},{"line_number":233,"context_line":"            if self.ssl_enabled:"},{"line_number":234,"context_line":"                self.scheme \u003d \u0027swift+https\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_66c8f8a8","line":231,"updated":"2015-12-03 11:36:51.000000000","message":"Not reason for -1 Is it related somehow to the fix:)?","commit_id":"fe4c38966a1cfaa4f3c0433fb21b047b9f71e488"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"1b5f177212d8f6afa5e8339ec601a04ad75183a0","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            store \u003d self.conf.glance_store.default_swift_reference"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"            return \u0027%s://%s/%s/%s\u0027 % (\u0027swift+config\u0027, store, container, obj)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        if self.scheme \u003d\u003d \u0027swift+config\u0027:"},{"line_number":233,"context_line":"            if self.ssl_enabled:"},{"line_number":234,"context_line":"                self.scheme \u003d \u0027swift+https\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_a336cd4e","line":231,"in_reply_to":"9a8ffd7b_66c8f8a8","updated":"2015-12-03 12:07:42.000000000","message":"Of course ;) Nah, it was an accidental change.","commit_id":"fe4c38966a1cfaa4f3c0433fb21b047b9f71e488"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"b582847fa0e81fc93ca060dab752f2649443c713","unresolved":false,"context_lines":[{"line_number":241,"context_line":"                                    container, obj)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def _get_auth_version(self, url):"},{"line_number":244,"context_line":"        if not url.endswith(\u0027/\u0027):"},{"line_number":245,"context_line":"            url +\u003d \u0027/\u0027"},{"line_number":246,"context_line":"        try:"},{"line_number":247,"context_line":"            version_string \u003d url.rsplit(\"/\", 2)[-2]"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_e08dab31","line":244,"updated":"2015-12-03 11:36:51.000000000","message":"I am not sure we need to extract auth_version for auth_address.\nI would rather prefer to extract this from swift store configuration:\nswift_store_auth_version parameter.\nIf auth_address and auth version contradicts then it is a configuration error.\nI also think that it is simple and obvious to have this value extracted from config only.","commit_id":"fe4c38966a1cfaa4f3c0433fb21b047b9f71e488"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"1b5f177212d8f6afa5e8339ec601a04ad75183a0","unresolved":false,"context_lines":[{"line_number":241,"context_line":"                                    container, obj)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def _get_auth_version(self, url):"},{"line_number":244,"context_line":"        if not url.endswith(\u0027/\u0027):"},{"line_number":245,"context_line":"            url +\u003d \u0027/\u0027"},{"line_number":246,"context_line":"        try:"},{"line_number":247,"context_line":"            version_string \u003d url.rsplit(\"/\", 2)[-2]"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_8324e95f","line":244,"in_reply_to":"9a8ffd7b_e08dab31","updated":"2015-12-03 12:07:42.000000000","message":"The reason we need to get this is because if they use the old style of storing it in the database, but then upgrade there config to use keystone v3 as they move to keystone v3. It would cause all the old style images to stop working. As the url has changed.\n\nSee: bug/1507610","commit_id":"fe4c38966a1cfaa4f3c0433fb21b047b9f71e488"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"b582847fa0e81fc93ca060dab752f2649443c713","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        HTTPS is assumed, unless \u0027swift+http\u0027 is specified."},{"line_number":376,"context_line":"        \"\"\""},{"line_number":377,"context_line":"        if self.auth_or_store_url.startswith(\u0027http\u0027):"},{"line_number":378,"context_line":"            self.auth_version \u003d self._get_auth_version(self.auth_or_store_url)"},{"line_number":379,"context_line":"            return self.auth_or_store_url"},{"line_number":380,"context_line":"        else:"},{"line_number":381,"context_line":"            if self.scheme \u003d\u003d \u0027swift+config\u0027:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_e0e28bd4","line":378,"updated":"2015-12-03 11:36:51.000000000","message":"IIUC self.auth_or_store_url contains store url for multi-tenant store. So it doesn\u0027t have auth_version at the end.","commit_id":"fe4c38966a1cfaa4f3c0433fb21b047b9f71e488"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"b582847fa0e81fc93ca060dab752f2649443c713","unresolved":false,"context_lines":[{"line_number":736,"context_line":"                raise"},{"line_number":737,"context_line":""},{"line_number":738,"context_line":"    def get_connection(self, location, context\u003dNone):"},{"line_number":739,"context_line":"        location.swift_url"},{"line_number":740,"context_line":"        self.auth_version \u003d self._option_get(\u0027swift_store_auth_version\u0027) or 2"},{"line_number":741,"context_line":""},{"line_number":742,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_a05b2385","line":739,"updated":"2015-12-03 11:36:51.000000000","message":"I think you can avoid this if you initialize auth_version from swift store configuration except you want auth_version to be fetched automatically. So we should not use swift_store_auth_version value in this case.","commit_id":"fe4c38966a1cfaa4f3c0433fb21b047b9f71e488"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"731763ff732fbef445cf57f8c1b743ac6e69ee74","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                return \u00272\u0027"},{"line_number":250,"context_line":"            if version_string[1:] \u003d\u003d \u00273\u0027:"},{"line_number":251,"context_line":"                return \u00273\u0027"},{"line_number":252,"context_line":"        except Exception:"},{"line_number":253,"context_line":"            pass"},{"line_number":254,"context_line":"        return None"},{"line_number":255,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_4b681a88","line":252,"updated":"2015-12-09 14:34:14.000000000","message":"Could we be less generic? Wouldn\u0027t \"except IndexError\" be better?","commit_id":"089e53a260bb702a208130f9464d261e9ab51a3d"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"731763ff732fbef445cf57f8c1b743ac6e69ee74","unresolved":false,"context_lines":[{"line_number":250,"context_line":"            if version_string[1:] \u003d\u003d \u00273\u0027:"},{"line_number":251,"context_line":"                return \u00273\u0027"},{"line_number":252,"context_line":"        except Exception:"},{"line_number":253,"context_line":"            pass"},{"line_number":254,"context_line":"        return None"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def _get_conf_value_from_account_ref(self, netloc):"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_0ba532b4","line":253,"updated":"2015-12-09 14:34:14.000000000","message":"s/pass/return None/\n\n\"except ...: pass\" is seen as a vulnerability by some static checkers, and it is a weird control flow mechanism, though quite common in Python.","commit_id":"089e53a260bb702a208130f9464d261e9ab51a3d"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"731763ff732fbef445cf57f8c1b743ac6e69ee74","unresolved":false,"context_lines":[{"line_number":734,"context_line":""},{"line_number":735,"context_line":"    def get_connection(self, location, context\u003dNone):"},{"line_number":736,"context_line":"        self.auth_version \u003d self._option_get(\u0027swift_store_auth_version\u0027) or 2"},{"line_number":737,"context_line":""},{"line_number":738,"context_line":"        try:"},{"line_number":739,"context_line":"            default_ref \u003d self.conf.glance_store.default_swift_reference"},{"line_number":740,"context_line":"            default_swift_reference \u003d self.ref_params.get(default_ref)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_ee9314ff","line":737,"updated":"2015-12-09 14:34:14.000000000","message":"Here, self.auth_version might be an integer (2), and later, it might be set to the return value of get_auth_version, which is an integer.\n\nWhat is the right type for self.auth_version?","commit_id":"089e53a260bb702a208130f9464d261e9ab51a3d"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"82a9ec640c4dbbf18413bd5a5521f3d3a32b80ee","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        return \u0027%s://%s%s/%s/%s\u0027 % (self.scheme, credstring, auth_or_store_url,"},{"line_number":239,"context_line":"                                    container, obj)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def get_auth_version(self, url):"},{"line_number":242,"context_line":"        if not url.endswith(\u0027/\u0027):"},{"line_number":243,"context_line":"            url +\u003d \u0027/\u0027"},{"line_number":244,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_241d4662","line":241,"updated":"2015-12-11 11:05:25.000000000","message":"So I was stated in mail thread it is better to rely on configuration instead of keeping this value in database. I think agree we should use configuration value to provide a unified approach for the users.","commit_id":"4e048a9bfe981a5e8f1cac8450cee9059bd67994"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"316ee2d51d12f9f512cb20ea718c87fb10100cc8","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        return \u0027%s://%s%s/%s/%s\u0027 % (self.scheme, credstring, auth_or_store_url,"},{"line_number":239,"context_line":"                                    container, obj)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def get_auth_version(self, url):"},{"line_number":242,"context_line":"        if not url.endswith(\u0027/\u0027):"},{"line_number":243,"context_line":"            url +\u003d \u0027/\u0027"},{"line_number":244,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_17aaf019","line":241,"updated":"2015-12-10 15:30:16.000000000","message":"Sorry, I missed this during my first review, but since this does not use \"self\", it should probably be outside of the class, or declared as a staticmethod. WDYT?","commit_id":"4e048a9bfe981a5e8f1cac8450cee9059bd67994"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"82a9ec640c4dbbf18413bd5a5521f3d3a32b80ee","unresolved":false,"context_lines":[{"line_number":733,"context_line":"                raise"},{"line_number":734,"context_line":""},{"line_number":735,"context_line":"    def get_connection(self, location, context\u003dNone):"},{"line_number":736,"context_line":"        self.auth_version \u003d self._option_get("},{"line_number":737,"context_line":"            \u0027swift_store_auth_version\u0027) or \u00272\u0027"},{"line_number":738,"context_line":""},{"line_number":739,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_44289233","line":736,"updated":"2015-12-11 11:05:25.000000000","message":"I think that configure or configure_add would be more appropriate place to define self.auth_version","commit_id":"4e048a9bfe981a5e8f1cac8450cee9059bd67994"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"7d79fe3c025fd7c26df6beaf41be0b504a817e86","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        self.auth_or_store_url \u003d self.specs.get(\u0027auth_or_store_url\u0027)"},{"line_number":203,"context_line":"        self.container \u003d self.specs.get(\u0027container\u0027)"},{"line_number":204,"context_line":"        self.obj \u003d self.specs.get(\u0027obj\u0027)"},{"line_number":205,"context_line":"        self.auth_version \u003d None"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def _get_credstring(self):"},{"line_number":208,"context_line":"        if self.user and self.key:"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba63e191_caa611c1","line":205,"updated":"2016-01-19 13:31:38.000000000","message":"I cannot find any reference to this attribute in the code.\nCould you please explain why do we need it?","commit_id":"1d19f2406887606e3c33b8af241ab05e79924f79"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"7d79fe3c025fd7c26df6beaf41be0b504a817e86","unresolved":false,"context_lines":[{"line_number":423,"context_line":"            raise exceptions.BadStoreConfiguration(store_name\u003d\"swift\","},{"line_number":424,"context_line":"                                                   reason\u003dmsg)"},{"line_number":425,"context_line":"        self.auth_version \u003d self._option_get("},{"line_number":426,"context_line":"            \u0027swift_store_auth_version\u0027) or \u00272\u0027"},{"line_number":427,"context_line":""},{"line_number":428,"context_line":"        try:"},{"line_number":429,"context_line":"            default_ref \u003d self.conf.glance_store.default_swift_reference"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba63e191_2acb2d55","line":426,"range":{"start_line":426,"start_character":43,"end_line":426,"end_character":44},"updated":"2016-01-19 13:31:38.000000000","message":"swift_store_auth_version has \u00272\u0027 by default. Do we need second operand in the \"or\" expression?","commit_id":"1d19f2406887606e3c33b8af241ab05e79924f79"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"956e42b4cde0512d6ce6a28dc8b1c6d3428eb5ba","unresolved":false,"context_lines":[{"line_number":767,"context_line":"            self.project_domain_id \u003d default_swift_reference.get("},{"line_number":768,"context_line":"                \u0027project_domain_id\u0027)"},{"line_number":769,"context_line":"            self.project_domain_name \u003d default_swift_reference.get("},{"line_number":770,"context_line":"                \u0027project_domain_name\u0027)"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"        if not (self.auth_address and self.user and self.key):"},{"line_number":773,"context_line":"            reason \u003d _(\"A value for swift auth_address, swift user and swift \""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba63e191_e3fd626f","line":770,"updated":"2016-01-18 23:54:35.000000000","message":"I\u0027m always confused on whether name or id should be used! BAH!","commit_id":"1d19f2406887606e3c33b8af241ab05e79924f79"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"7d79fe3c025fd7c26df6beaf41be0b504a817e86","unresolved":false,"context_lines":[{"line_number":833,"context_line":"            LOG.info(reason)"},{"line_number":834,"context_line":"            raise exceptions.BadStoreUri(message\u003dreason)"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"        auth_url \u003d location.swift_url"},{"line_number":837,"context_line":"        if not auth_url.endswith(\u0027/\u0027):"},{"line_number":838,"context_line":"            auth_url +\u003d \u0027/\u0027"},{"line_number":839,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba63e191_6a9fe503","line":836,"updated":"2016-01-19 13:31:38.000000000","message":"Shouldn\u0027t we use self.auth_address here?\nOtherwise, we will have the following situation (as described in the mail): we will use auth_address stored in db instead of consuming config option.","commit_id":"1d19f2406887606e3c33b8af241ab05e79924f79"}]}
