)]}'
{"smaug/openstack/common/loopingcall.py":[{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2dda3d2a165b2a5d5fec705cd3520e76f4a407ed","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import logging"},{"line_number":19,"context_line":"import sys"},{"line_number":20,"context_line":"import time"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_d0272eb4","line":17,"range":{"start_line":17,"start_character":0,"end_line":17,"end_character":0},"updated":"2016-02-17 14:44:56.000000000","message":"This entire implementation is a problematic. It contains a lot of duplicated code.\n\nWhat I suggest is:\n* extending the result object so that it can be used by any mechanism that requires waiting for a long running operation.\n* Instead of extending a base class using the Strategy design pattern to allow different delay strategies.\n* Making it a function instead of a class since you really need the state of the result object and not the state of the call generator.\n\nI added a small code example to illustrate what I\u0027m talking about.\n\n\nhttp://fpaste.org/324066/45571841/\n\nAlso, not in my implementation but required. Is adding the possibility for setting up a callback in the future object so you don\u0027t have to wait on it.","commit_id":"b77dbdca7afdf67ec173c266fe2edd539e2e4b26"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2dda3d2a165b2a5d5fec705cd3520e76f4a407ed","unresolved":false,"context_lines":[{"line_number":29,"context_line":"# NOTE(zyluo): This lambda function was declared to avoid mocking collisions"},{"line_number":30,"context_line":"#              with time.time() called in the standard logging module"},{"line_number":31,"context_line":"#              during unittests."},{"line_number":32,"context_line":"_ts \u003d lambda: time.time()"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class LoopingCallDone(Exception):"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_9f24a660","line":32,"range":{"start_line":32,"start_character":14,"end_line":32,"end_character":25},"updated":"2016-02-17 14:44:56.000000000","message":"You don\u0027t actually want the clock time, you want the monotonic time value. You can get that from os.times()[-1].","commit_id":"b77dbdca7afdf67ec173c266fe2edd539e2e4b26"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2dda3d2a165b2a5d5fec705cd3520e76f4a407ed","unresolved":false,"context_lines":[{"line_number":32,"context_line":"_ts \u003d lambda: time.time()"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class LoopingCallDone(Exception):"},{"line_number":36,"context_line":"    \"\"\"Exception to break out and stop a LoopingCallBase."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    The poll-function passed to LoopingCallBase can raise this exception to"},{"line_number":39,"context_line":"    break out of the loop normally. This is somewhat analogous to"},{"line_number":40,"context_line":"    StopIteration."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    An optional return-value can be included as the argument to the exception;"},{"line_number":43,"context_line":"    this return-value will be returned by LoopingCallBase.wait()"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    \"\"\""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def __init__(self, retvalue\u003dTrue):"},{"line_number":48,"context_line":"        \"\"\":param retvalue: Value that LoopingCallBase.wait() should return.\"\"\""},{"line_number":49,"context_line":"        self.retvalue \u003d retvalue"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"class LoopingCallBase(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_33cdc485","line":49,"range":{"start_line":35,"start_character":0,"end_line":49,"end_character":32},"updated":"2016-02-17 14:44:56.000000000","message":"I don\u0027t think that using an exception to create a return value is the right way to go.\n\nWe could instead use the generator feature in python. Instead of being able to return True to keep going and False to stop.\n\nTo be able to return information just return two values.\n\n return True, 5\nor\n return False, result","commit_id":"b77dbdca7afdf67ec173c266fe2edd539e2e4b26"}],"smaug/protection/bank_plugins/swift.py":[{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"78c51b394493a046a5231152d67ad1be29a23110","unresolved":false,"context_lines":[{"line_number":53,"context_line":"\r"},{"line_number":54,"context_line":"\r"},{"line_number":55,"context_line":"class SwiftBankPlugin(BankPlugin):\r"},{"line_number":56,"context_line":"    def __init__(self, conf):\r"},{"line_number":57,"context_line":"        super(BankPlugin, self).__init__()\r"},{"line_number":58,"context_line":"        self.authurl \u003d conf.authurl\r"},{"line_number":59,"context_line":"        self.user \u003d conf.user\r"}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_1b267368","line":56,"range":{"start_line":56,"start_character":23,"end_line":56,"end_character":27},"updated":"2016-02-14 09:09:33.000000000","message":"If all options come from CONF, why need to pass as a parameter?","commit_id":"43de314b45b2c484fc758940b9b5598bc7cb7509"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"78c51b394493a046a5231152d67ad1be29a23110","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        super(BankPlugin, self).__init__()\r"},{"line_number":58,"context_line":"        self.authurl \u003d conf.authurl\r"},{"line_number":59,"context_line":"        self.user \u003d conf.user\r"},{"line_number":60,"context_line":"        self.password \u003d conf.password\r"},{"line_number":61,"context_line":"        self.expire_window \u003d conf.expire_window\r"},{"line_number":62,"context_line":"        self.renew_window \u003d conf.renew_window\r"},{"line_number":63,"context_line":"        # TODO(luobin):init validity_window according to renew_window\r"}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_dbc6cb15","line":60,"updated":"2016-02-14 09:09:33.000000000","message":"I think we should provide a way to use the token that already got while smaug\u0027s own authorization, as heat\u0027s implementation.","commit_id":"43de314b45b2c484fc758940b9b5598bc7cb7509"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"78c51b394493a046a5231152d67ad1be29a23110","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        # TODO(luobin):init validity_window according to renew_window\r"},{"line_number":64,"context_line":"        self.validity_window \u003d conf.validity_window\r"},{"line_number":65,"context_line":"        self.expire_time \u003d time.time()\r"},{"line_number":66,"context_line":"        self.connection \u003d swift.Connection(authurl\u003dself.authurl,\r"},{"line_number":67,"context_line":"                                           user\u003dself.user,\r"},{"line_number":68,"context_line":"                                           key\u003dself.password)\r"},{"line_number":69,"context_line":"        self.owner_id \u003d str(uuid.uuid4())\r"}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_dbdc0b1b","line":66,"updated":"2016-02-14 09:09:33.000000000","message":"Missing tenant_name?","commit_id":"43de314b45b2c484fc758940b9b5598bc7cb7509"}],"smaug/services/protection/bank_plugins/swift.py":[{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2dda3d2a165b2a5d5fec705cd3520e76f4a407ed","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        self.lease_validity_window \u003d CONF.lease_validity_window\r"},{"line_number":100,"context_line":"        self.lease_expire_time \u003d 0\r"},{"line_number":101,"context_line":"\r"},{"line_number":102,"context_line":"        if CONF.bank_swift_auth \u003d\u003d \"single_user\":\r"},{"line_number":103,"context_line":"            self.connection \u003d swift.Connection(\r"},{"line_number":104,"context_line":"                authurl\u003dCONF.bank_swift_auth_url,\r"},{"line_number":105,"context_line":"                auth_version\u003dCONF.bank_swift_auth_version,\r"},{"line_number":106,"context_line":"                tenant_name\u003dCONF.bank_swift_tenant_name,\r"},{"line_number":107,"context_line":"                user\u003dCONF.bank_swift_user,\r"},{"line_number":108,"context_line":"                key\u003dCONF.bank_swift_key,\r"},{"line_number":109,"context_line":"                retries\u003dself.bank_swift_retry_attempts,\r"},{"line_number":110,"context_line":"                starting_backoff\u003dself.bank_swift_retry_backoff,\r"},{"line_number":111,"context_line":"                insecure\u003dself.bank_swift_auth_insecure,\r"},{"line_number":112,"context_line":"                cacert\u003dself.bank_swift_ca_cert_file)\r"},{"line_number":113,"context_line":"        else:\r"},{"line_number":114,"context_line":"            self.connection \u003d swift.Connection(\r"},{"line_number":115,"context_line":"                preauthurl\u003dCONF.bank_swift_url,\r"},{"line_number":116,"context_line":"                preauthtoken\u003dself.context.auth_token,\r"},{"line_number":117,"context_line":"                retries\u003dself.bank_swift_retry_attempts,\r"},{"line_number":118,"context_line":"                starting_backoff\u003dself.bank_swift_retry_backoff,\r"},{"line_number":119,"context_line":"                insecure\u003dself.bank_swift_auth_insecure,\r"},{"line_number":120,"context_line":"                cacert\u003dself.bank_swift_ca_cert_file)\r"},{"line_number":121,"context_line":"\r"},{"line_number":122,"context_line":"        # TODO(luobin): create a uuid of this bank_plugin\r"},{"line_number":123,"context_line":"        self.owner_id \u003d str(uuid.uuid4())\r"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_13336063","line":120,"range":{"start_line":102,"start_character":0,"end_line":120,"end_character":52},"updated":"2016-02-17 14:44:56.000000000","message":"move to def _set_up_connection() to simplify initializer.","commit_id":"b77dbdca7afdf67ec173c266fe2edd539e2e4b26"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2dda3d2a165b2a5d5fec705cd3520e76f4a407ed","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        # TODO(luobin): create a uuid of this bank_plugin\r"},{"line_number":123,"context_line":"        self.owner_id \u003d str(uuid.uuid4())\r"},{"line_number":124,"context_line":"\r"},{"line_number":125,"context_line":"        try:\r"},{"line_number":126,"context_line":"            self.acquire_lease()\r"},{"line_number":127,"context_line":"            renew_lease_loop \u003d loopingcall.FixedIntervalLoopingCall(\r"},{"line_number":128,"context_line":"                self.renew_lease)\r"},{"line_number":129,"context_line":"            renew_lease_loop.start(interval\u003dself.lease_renew_window,\r"},{"line_number":130,"context_line":"                                   initial_delay\u003dself.lease_renew_window)\r"},{"line_number":131,"context_line":"        except SwiftConnectionFailed as err:\r"},{"line_number":132,"context_line":"            LOG.err(\"bank plugin acquire lease failed!\")\r"},{"line_number":133,"context_line":"            raise err\r"},{"line_number":134,"context_line":"\r"},{"line_number":135,"context_line":"    def create_object(self, key, value):\r"},{"line_number":136,"context_line":"        try:\r"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_934c90c9","line":133,"range":{"start_line":125,"start_character":8,"end_line":133,"end_character":21},"updated":"2016-02-17 14:44:56.000000000","message":"This can happen at any time. How do we handle that?","commit_id":"b77dbdca7afdf67ec173c266fe2edd539e2e4b26"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2dda3d2a165b2a5d5fec705cd3520e76f4a407ed","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            self._put_object(container\u003dself.bank_checkpoints_container,\r"},{"line_number":147,"context_line":"                             obj\u003dkey,\r"},{"line_number":148,"context_line":"                             contents\u003dvalue)\r"},{"line_number":149,"context_line":"        except SwiftConnectionFailed as err:\r"},{"line_number":150,"context_line":"            LOG.err(\"update object failed, err: %s\" % err)\r"},{"line_number":151,"context_line":"\r"},{"line_number":152,"context_line":"    def delete_object(self, key):\r"},{"line_number":153,"context_line":"        try:\r"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_338824c5","line":150,"range":{"start_line":149,"start_character":0,"end_line":150,"end_character":58},"updated":"2016-02-17 14:44:56.000000000","message":"You keep hiding the exception. This is unacceptable since the caller will need to know if the bank operation failed.","commit_id":"b77dbdca7afdf67ec173c266fe2edd539e2e4b26"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2dda3d2a165b2a5d5fec705cd3520e76f4a407ed","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        try:\r"},{"line_number":154,"context_line":"            self._delete_object(container\u003dself.bank_checkpoints_container,\r"},{"line_number":155,"context_line":"                                obj\u003dkey)\r"},{"line_number":156,"context_line":"        except SwiftConnectionFailed as err:\r"},{"line_number":157,"context_line":"            LOG.err(\"delete object failed, err: %s\" % err)\r"},{"line_number":158,"context_line":"\r"},{"line_number":159,"context_line":"    def get_object(self, key):\r"},{"line_number":160,"context_line":"        try:\r"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_738e2cd1","line":157,"range":{"start_line":156,"start_character":0,"end_line":157,"end_character":58},"updated":"2016-02-17 14:44:56.000000000","message":"ditto","commit_id":"b77dbdca7afdf67ec173c266fe2edd539e2e4b26"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2dda3d2a165b2a5d5fec705cd3520e76f4a407ed","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        try:\r"},{"line_number":161,"context_line":"            return self._get_object(container\u003dself.bank_checkpoints_container,\r"},{"line_number":162,"context_line":"                                    obj\u003dkey)\r"},{"line_number":163,"context_line":"        except SwiftConnectionFailed as err:\r"},{"line_number":164,"context_line":"            LOG.err(\"get object failed, err: %s\" % err)\r"},{"line_number":165,"context_line":"\r"},{"line_number":166,"context_line":"    def list_objects(self, options):\r"},{"line_number":167,"context_line":"        objects \u003d []\r"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_33af842b","line":164,"range":{"start_line":163,"start_character":0,"end_line":164,"end_character":55},"updated":"2016-02-17 14:44:56.000000000","message":"ditto","commit_id":"b77dbdca7afdf67ec173c266fe2edd539e2e4b26"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"2dda3d2a165b2a5d5fec705cd3520e76f4a407ed","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        except SwiftConnectionFailed as err:\r"},{"line_number":164,"context_line":"            LOG.err(\"get object failed, err: %s\" % err)\r"},{"line_number":165,"context_line":"\r"},{"line_number":166,"context_line":"    def list_objects(self, options):\r"},{"line_number":167,"context_line":"        objects \u003d []\r"},{"line_number":168,"context_line":"        try:\r"},{"line_number":169,"context_line":"            if options is None:\r"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_d600c603","line":166,"range":{"start_line":166,"start_character":0,"end_line":166,"end_character":36},"updated":"2016-02-17 14:44:56.000000000","message":"Listing needs a simpler interface. This is very swift specific.\n\nThe interface needs to be change to:\n list_objects(self, prefix):\n\nand all the complexity hidden inside a generator.","commit_id":"b77dbdca7afdf67ec173c266fe2edd539e2e4b26"}],"smaug/services/protection/bank_plugins/swift_bank_plugin.py":[{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"1b0359531513ef5572b35865120cf89ed502fa7d","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import time"},{"line_number":23,"context_line":"import uuid"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"swift_client_opts \u003d ["},{"line_number":26,"context_line":"    cfg.StrOpt(\u0027bank_swift_url\u0027,"},{"line_number":27,"context_line":"               help\u003d\u0027The URL of the Swift endpoint\u0027),"},{"line_number":28,"context_line":"    cfg.StrOpt(\u0027bank_swift_auth_url\u0027,"},{"line_number":29,"context_line":"               help\u003d\u0027The URL of the Keystone endpoint\u0027),"},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027bank_swift_auth\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027single_user\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Swift authentication mechanism\u0027),"},{"line_number":33,"context_line":"    cfg.StrOpt(\u0027bank_swift_auth_version\u0027,"},{"line_number":34,"context_line":"               default\u003d\u00271\u0027,"},{"line_number":35,"context_line":"               help\u003d\u0027Swift authentication version. \u0027"},{"line_number":36,"context_line":"                    \u0027Specify \"1\" for auth 1.0, or \"2\" for auth 2.0\u0027),"},{"line_number":37,"context_line":"    cfg.StrOpt(\u0027bank_swift_tenant_name\u0027,"},{"line_number":38,"context_line":"               help\u003d\u0027Swift tenant/account name. \u0027"},{"line_number":39,"context_line":"                    \u0027Required when connecting to an auth 2.0 system\u0027),"},{"line_number":40,"context_line":"    cfg.StrOpt(\u0027bank_swift_user\u0027,"},{"line_number":41,"context_line":"               help\u003d\u0027Swift user name\u0027),"},{"line_number":42,"context_line":"    cfg.StrOpt(\u0027bank_swift_key\u0027,"},{"line_number":43,"context_line":"               help\u003d\u0027Swift key for authentication\u0027),"},{"line_number":44,"context_line":"    cfg.IntOpt(\u0027bank_swift_retry_attempts\u0027,"},{"line_number":45,"context_line":"               default\u003d3,"},{"line_number":46,"context_line":"               help\u003d\u0027The number of retries to make for \u0027"},{"line_number":47,"context_line":"                    \u0027Swift operations\u0027),"},{"line_number":48,"context_line":"    cfg.IntOpt(\u0027bank_swift_retry_backoff\u0027,"},{"line_number":49,"context_line":"               default\u003d2,"},{"line_number":50,"context_line":"               help\u003d\u0027The backoff time in seconds \u0027"},{"line_number":51,"context_line":"                    \u0027between Swift retries\u0027),"},{"line_number":52,"context_line":"    cfg.StrOpt(\u0027bank_swift_ca_cert_file\u0027,"},{"line_number":53,"context_line":"               help\u003d\u0027Location of the CA certificate file \u0027"},{"line_number":54,"context_line":"                    \u0027to use for swift client requests.\u0027),"},{"line_number":55,"context_line":"    cfg.BoolOpt(\u0027bank_swift_auth_insecure\u0027,"},{"line_number":56,"context_line":"                default\u003dFalse,"},{"line_number":57,"context_line":"                help\u003d\u0027Bypass verification of server certificate when \u0027"},{"line_number":58,"context_line":"                     \u0027making SSL connection to Swift.\u0027),"},{"line_number":59,"context_line":"]"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"CONF \u003d cfg.CONF"},{"line_number":62,"context_line":"CONF.register_opts(swift_client_opts, \"swift_client\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"3afc51ec_7ed74d23","line":59,"range":{"start_line":25,"start_character":0,"end_line":59,"end_character":1},"updated":"2016-03-14 15:36:43.000000000","message":"All this setting should be part of the provider configured by the Admin, we will probably need a configuration file per provider.\n\nWe can merge this one if we agree that all this setting should not be part of the main smaug.conf but should be part of the \u003cname\u003e_provider.conf","commit_id":"97cda0be1b2e571c9dd754775ba77bf5d6a7eb34"}],"smaug/services/protection/plugins/swift_bank_plugin.py":[{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"189127e2fe760b973feeb0f551a61c39cbb7f684","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        try:\r"},{"line_number":108,"context_line":"            self.acquire_lease()\r"},{"line_number":109,"context_line":"        except SwiftConnectionFailed as err:\r"},{"line_number":110,"context_line":"            LOG.err(\"bank plugin acquire lease failed!\")\r"},{"line_number":111,"context_line":"            raise err\r"},{"line_number":112,"context_line":"\r"},{"line_number":113,"context_line":"        # start renew lease\r"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_f9c2f083","line":110,"range":{"start_line":110,"start_character":12,"end_line":110,"end_character":19},"updated":"2016-02-24 03:21:44.000000000","message":"Use LOG.error.\nAnd the constant message string should be parenthesized by _LE()","commit_id":"465e0dba3f54dd4d7cee77d3f0be824fb806e0ce"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"189127e2fe760b973feeb0f551a61c39cbb7f684","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            self.lease_expire_time \u003d long(\r"},{"line_number":220,"context_line":"                time.time()) + self.lease_expire_window\r"},{"line_number":221,"context_line":"        except SwiftConnectionFailed as err:\r"},{"line_number":222,"context_line":"            LOG.err(\"acquire lease failed, err:%s\" % err)\r"},{"line_number":223,"context_line":"\r"},{"line_number":224,"context_line":"    def check_lease_validity(self):\r"},{"line_number":225,"context_line":"        if self.lease_expire_time - \\\r"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_14eb19e0","line":222,"updated":"2016-02-24 03:21:44.000000000","message":"missing raise?","commit_id":"465e0dba3f54dd4d7cee77d3f0be824fb806e0ce"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"189127e2fe760b973feeb0f551a61c39cbb7f684","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            LOG.err(\"acquire lease failed, err:%s\" % err)\r"},{"line_number":223,"context_line":"\r"},{"line_number":224,"context_line":"    def check_lease_validity(self):\r"},{"line_number":225,"context_line":"        if self.lease_expire_time - \\\r"},{"line_number":226,"context_line":"                long(time.time()) \u003e\u003d self.lease_validity_window:\r"},{"line_number":227,"context_line":"            return True\r"},{"line_number":228,"context_line":"        else:\r"},{"line_number":229,"context_line":"            return False\r"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_b4706da5","line":226,"range":{"start_line":225,"start_character":11,"end_line":226,"end_character":63},"updated":"2016-02-24 03:21:44.000000000","message":"Could use (), rather than the backslash to connect these two lines.","commit_id":"465e0dba3f54dd4d7cee77d3f0be824fb806e0ce"},{"author":{"_account_id":16203,"name":"zengyingzhe","email":"zengyingzhe@huawei.com","username":"zengyingzhe"},"change_message_id":"189127e2fe760b973feeb0f551a61c39cbb7f684","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                                                       obj\u003dobj)\r"},{"line_number":244,"context_line":"            return body\r"},{"line_number":245,"context_line":"        except ClientException as err:\r"},{"line_number":246,"context_line":"            raise SwiftConnectionFailed(reason\u003derr)\r"},{"line_number":247,"context_line":"\r"},{"line_number":248,"context_line":"    def _post_object(self, container, obj, headers):\r"},{"line_number":249,"context_line":"        try:\r"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_793700ff","line":246,"range":{"start_line":246,"start_character":18,"end_line":246,"end_character":39},"updated":"2016-02-24 03:21:44.000000000","message":"Not all exceptions are connection fail.\nHere might also get exception cause object not found.\nEither distinguish these exceptions, or define a more common exception type rather than SwiftConnectionFailed.","commit_id":"465e0dba3f54dd4d7cee77d3f0be824fb806e0ce"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"207703f116b1db9b620c81b64f83a341016f1cc4","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                cacert\u003dself.bank_swift_ca_cert_file)\r"},{"line_number":139,"context_line":"        return connection\r"},{"line_number":140,"context_line":"\r"},{"line_number":141,"context_line":"    def ch_container(self, container):\r"},{"line_number":142,"context_line":"        self.container \u003d container\r"},{"line_number":143,"context_line":"\r"},{"line_number":144,"context_line":"    def create_object(self, key, value):\r"},{"line_number":145,"context_line":"        try:\r"}],"source_content_type":"text/x-python","patch_set":9,"id":"bae84128_1fb5d17c","line":142,"range":{"start_line":141,"start_character":0,"end_line":142,"end_character":34},"updated":"2016-02-24 15:08:56.000000000","message":"Container is an implementation detail.","commit_id":"eda530ec4f59130eeea9acfdb768e9bbccdc5f6e"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"207703f116b1db9b620c81b64f83a341016f1cc4","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                             contents\u003dvalue)\r"},{"line_number":150,"context_line":"        except SwiftConnectionFailed as err:\r"},{"line_number":151,"context_line":"            LOG.error(_LE(\"create object failed, err: %s\"), err)\r"},{"line_number":152,"context_line":"            raise err\r"},{"line_number":153,"context_line":"\r"},{"line_number":154,"context_line":"    def update_object(self, key, value):\r"},{"line_number":155,"context_line":"        try:\r"}],"source_content_type":"text/x-python","patch_set":9,"id":"bae84128_bf4f8590","line":152,"range":{"start_line":152,"start_character":12,"end_line":152,"end_character":21},"updated":"2016-02-24 15:08:56.000000000","message":"use:\n raise\ninstead of:\n raise err\n\nsince the latter changes the stack trace","commit_id":"eda530ec4f59130eeea9acfdb768e9bbccdc5f6e"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"cbef6232d389a802e8945beeff2d192d2f0294ba","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                default\u003dFalse,\r"},{"line_number":57,"context_line":"                help\u003d\u0027Bypass verification of server certificate when \u0027\r"},{"line_number":58,"context_line":"                     \u0027making SSL connection to Swift.\u0027),\r"},{"line_number":59,"context_line":"    cfg.StrOpt(\u0027bank_object_container\u0027,\r"},{"line_number":60,"context_line":"               default\u003d\u0027checkpoints\u0027,\r"},{"line_number":61,"context_line":"               help\u003d\u0027The default swift container to use.\u0027),\r"},{"line_number":62,"context_line":"]\r"}],"source_content_type":"text/x-python","patch_set":10,"id":"7af24918_367897f8","line":59,"range":{"start_line":59,"start_character":16,"end_line":59,"end_character":37},"updated":"2016-03-05 07:32:13.000000000","message":"I think that this configuration is specific for swift \nSo it should include bank_swift...","commit_id":"aa8b57c2fd0a069d398cf024b56980436017eecd"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"cbef6232d389a802e8945beeff2d192d2f0294ba","unresolved":false,"context_lines":[{"line_number":61,"context_line":"               help\u003d\u0027The default swift container to use.\u0027),\r"},{"line_number":62,"context_line":"]\r"},{"line_number":63,"context_line":"\r"},{"line_number":64,"context_line":"bank_lease_opts \u003d [\r"},{"line_number":65,"context_line":"    cfg.IntOpt(\u0027lease_renew_window\u0027,\r"},{"line_number":66,"context_line":"               default\u003d120,\r"},{"line_number":67,"context_line":"               help\u003d\u0027period for bank lease, in seconds, \u0027\r"},{"line_number":68,"context_line":"                    \u0027between bank lease client renew the lease\u0027),\r"},{"line_number":69,"context_line":"    cfg.IntOpt(\u0027lease_expire_window\u0027,\r"},{"line_number":70,"context_line":"               default\u003d600,\r"},{"line_number":71,"context_line":"               help\u003d\u0027expired_window for bank lease, in seconds\u0027),\r"},{"line_number":72,"context_line":"    cfg.IntOpt(\u0027lease_validity_window\u0027,\r"},{"line_number":73,"context_line":"               default\u003d100,\r"},{"line_number":74,"context_line":"               help\u003d\u0027validity_window for bank lease, in seconds\u0027),\r"},{"line_number":75,"context_line":"]\r"},{"line_number":76,"context_line":"\r"},{"line_number":77,"context_line":"CONF \u003d cfg.CONF\r"},{"line_number":78,"context_line":"CONF.register_opts(bank_swift_opts)\r"}],"source_content_type":"text/x-python","patch_set":10,"id":"7af24918_9669ab28","line":75,"range":{"start_line":64,"start_character":0,"end_line":75,"end_character":1},"updated":"2016-03-05 07:32:13.000000000","message":"Thous are common parameters that should not be in the swift bank plugin","commit_id":"aa8b57c2fd0a069d398cf024b56980436017eecd"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"80b05ea363e8d4194706378ed894f20583975efe","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        self.owner_id \u003d str(uuid.uuid4())\r"},{"line_number":104,"context_line":"        self.lease_expire_time \u003d 0\r"},{"line_number":105,"context_line":"        self.bank_leases_container \u003d \"leases\"\r"},{"line_number":106,"context_line":"        self.bank_object_container \u003d CONF.bank_object_container\r"},{"line_number":107,"context_line":"        self.connection \u003d self._setup_connection()\r"},{"line_number":108,"context_line":"\r"},{"line_number":109,"context_line":"        # create container\r"}],"source_content_type":"text/x-python","patch_set":10,"id":"7af24918_bf390cdb","line":106,"range":{"start_line":106,"start_character":37,"end_line":106,"end_character":63},"updated":"2016-03-06 16:29:16.000000000","message":"container should be an instance configuration not a global configuration","commit_id":"aa8b57c2fd0a069d398cf024b56980436017eecd"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"cbef6232d389a802e8945beeff2d192d2f0294ba","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            self._put_container(self.bank_leases_container)\r"},{"line_number":113,"context_line":"        except SwiftConnectionFailed:\r"},{"line_number":114,"context_line":"            LOG.error(_LE(\"bank plugin create container failed.\"))\r"},{"line_number":115,"context_line":"            raise\r"},{"line_number":116,"context_line":"\r"},{"line_number":117,"context_line":"        # acquire lease\r"},{"line_number":118,"context_line":"        try:\r"}],"source_content_type":"text/x-python","patch_set":10,"id":"7af24918_d6733314","line":115,"range":{"start_line":115,"start_character":12,"end_line":115,"end_character":17},"updated":"2016-03-05 07:32:13.000000000","message":"Please define an exception","commit_id":"aa8b57c2fd0a069d398cf024b56980436017eecd"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"cbef6232d389a802e8945beeff2d192d2f0294ba","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                             contents\u003dvalue)\r"},{"line_number":157,"context_line":"        except SwiftConnectionFailed as err:\r"},{"line_number":158,"context_line":"            LOG.error(_LE(\"create object failed, err: %s.\"), err)\r"},{"line_number":159,"context_line":"            raise\r"},{"line_number":160,"context_line":"\r"},{"line_number":161,"context_line":"    def update_object(self, key, value):\r"},{"line_number":162,"context_line":"        try:\r"}],"source_content_type":"text/x-python","patch_set":10,"id":"7af24918_d64a13ac","line":159,"range":{"start_line":159,"start_character":12,"end_line":159,"end_character":17},"updated":"2016-03-05 07:32:13.000000000","message":"Please define and exception or use existing one","commit_id":"aa8b57c2fd0a069d398cf024b56980436017eecd"}],"smaug/tests/unit/protection/fake_swift_client.py":[{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"cbef6232d389a802e8945beeff2d192d2f0294ba","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (C) 2012 Hewlett-Packard Development Company, L.P."},{"line_number":2,"context_line":"# Copyright (C) 2014 TrilioData, Inc"},{"line_number":3,"context_line":"# All Rights Reserved."},{"line_number":4,"context_line":"#"},{"line_number":5,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":6,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":10,"id":"7af24918_b6dae7e7","line":3,"range":{"start_line":1,"start_character":1,"end_line":3,"end_character":22},"updated":"2016-03-05 07:32:13.000000000","message":"Please remove unless the code  was copied from some where","commit_id":"aa8b57c2fd0a069d398cf024b56980436017eecd"}]}
