)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Youcef Laribi \u003cyoucef.laribi@citrix.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-11-20 20:57:01 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Implements a driver for the Neutron LBaaS service"},{"line_number":8,"context_line":"plugin that allows for using the Citrix NetScaler"},{"line_number":9,"context_line":"loadbalancing devices to provide Neutron LBaaS"},{"line_number":10,"context_line":"functionality."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"AAAATn%2F%2BsTY%3D","line":7,"updated":"2013-11-21 15:16:03.000000000","message":"For commit message, should have a one line summary, and then follow up with info on the change.","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":9,"context_line":"loadbalancing devices to provide Neutron LBaaS"},{"line_number":10,"context_line":"functionality."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Addressed Paul Michali\u0027s comments (in Patch Set 1) and"},{"line_number":13,"context_line":"enikanorov\u0027s comments (in Patch set 2)."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Ibfeb54c4402943fb3696a1c599fa373e42e520d4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"AAAATn%2F%2BsTU%3D","line":12,"updated":"2013-11-21 15:16:03.000000000","message":"Don\u0027t need to put this in here (I don\u0027t want to be immortalized :)","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"}],"etc/services/loadbalancer/netscaler/lbaas-netscaler.conf":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"6fed42126b8a39f66c6810837c101d1399f32cc1","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#NetScaler LBaaS Driver configuration parameters"},{"line_number":2,"context_line":"[netscaler_driver]"},{"line_number":3,"context_line":"#netscaler_ncc_uri \u003d https://ncc_server.acme.org/ncc/v1/api"},{"line_number":4,"context_line":"#netscaler_ncc_username \u003d admin"}],"source_content_type":"text/plain","patch_set":2,"id":"AAAATn%2F%2BvVg%3D","line":1,"updated":"2013-11-20 21:15:26.000000000","message":"currently we\u0027re gathering driver-related config in etc/services.conf","commit_id":"2cce9823fb6cf4df4c40a37a1ad0dfe57ebf1bb9"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#NetScaler LBaaS Driver configuration parameters"},{"line_number":2,"context_line":"[netscaler_driver]"},{"line_number":3,"context_line":"#netscaler_ncc_uri \u003d https://ncc_server.acme.org/ncc/v1/api"},{"line_number":4,"context_line":"#netscaler_ncc_username \u003d admin"}],"source_content_type":"text/plain","patch_set":5,"id":"AAAATn%2F%2Btf0%3D","line":1,"updated":"2013-11-21 09:32:35.000000000","message":"please use etc/services.conf which is intended for vendors config parameters","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#NetScaler LBaaS Driver configuration parameters"},{"line_number":2,"context_line":"[netscaler_driver]"},{"line_number":3,"context_line":"#netscaler_ncc_uri \u003d https://ncc_server.acme.org/ncc/v1/api"},{"line_number":4,"context_line":"#netscaler_ncc_username \u003d admin"}],"source_content_type":"text/plain","patch_set":6,"id":"AAAATn%2F%2Bae8%3D","line":1,"updated":"2013-11-26 11:50:27.000000000","message":"This file should be deleted now","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"}],"neutron/db/migration/alembic_migrations/env.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"8f29ad4c5a2ffd02560cc8d19dcdf320ca25bd98","unresolved":false,"context_lines":[{"line_number":41,"context_line":"active_plugins +\u003d neutron_config.service_plugins"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"for class_path in active_plugins:"},{"line_number":44,"context_line":"    print class_path"},{"line_number":45,"context_line":"    importutils.import_class(class_path)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"# set the target for \u0027autogenerate\u0027 support"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAUH%2F9t%2Fc%3D","line":44,"updated":"2014-02-04 18:06:45.000000000","message":"Debug left in?","commit_id":"36a297685413088d7c2655e6a7d1d3f7ee231028"}],"neutron/services/loadbalancer/drivers/netscaler/__init__.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2013 Citrix Systems, Inc."},{"line_number":4,"context_line":"#"},{"line_number":5,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F%2FYck%3D","line":2,"updated":"2014-01-14 12:23:20.000000000","message":"This file can be empty.","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"}],"neutron/services/loadbalancer/drivers/netscaler/ncc_client.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":47,"context_line":"HTTP_DEFAULT_PORT \u003d 80"},{"line_number":48,"context_line":"HTTPS_DEFAULT_PORT \u003d 443"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"HTTP_AUTH_FAILURE_STATUSCODE \u003d \u0027401\u0027"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"class NSClient:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvTs%3D","line":50,"updated":"2013-11-20 21:58:41.000000000","message":"Can use webob.exe packages HTTP codes for status.","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"class NSClient:"},{"line_number":54,"context_line":"    \"\"\"Client to operate on REST resources of NetScaler Control Center. \"\"\""},{"line_number":55,"context_line":"    def __init__(self, uri, username, password):"},{"line_number":56,"context_line":"        if not uri:"},{"line_number":57,"context_line":"            msg \u003d _(\"No NetScaler Control Center URI specified. \""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvVY%3D","line":54,"updated":"2013-11-20 21:58:41.000000000","message":"PEP257: Add blank line before and after class doc string.\n\nExtraneous space at end of string. Here and some others.\n\nEnsure period at end of summary lines for docstrings. (e.g. L155, L159)","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            base64string \u003d base64string[:-1]"},{"line_number":66,"context_line":"            self.auth \u003d \u0027Basic %s\u0027 % base64string"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def create_resource(self, tenant_id, resource_path, object_name,"},{"line_number":69,"context_line":"                        object_data):"},{"line_number":70,"context_line":"        \"\"\"Creates an HTTP REST resource of NetScaler Control Center.\"\"\""},{"line_number":71,"context_line":"        method \u003d HTTP_CREATE_METHOD"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvR4%3D","line":68,"updated":"2013-11-20 21:58:41.000000000","message":"In the four CRUD methods, there is quite a bit of duplicated code. Consider refactoring - maybe extracting more into a common method?","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":151,"context_line":"                             \"exception\": exc_type})"},{"line_number":152,"context_line":"            raise q_exc.ServiceUnavailable()"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    def _fromjson(self, payload):"},{"line_number":155,"context_line":"        \"\"\"Converts a json string into a python dictionary\"\"\""},{"line_number":156,"context_line":"        return json.loads(payload)"},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvWQ%3D","line":154,"updated":"2013-11-20 21:58:41.000000000","message":"Not sure of the value add of these two wrapper functions, over just using json.loads() and json.dumps().","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        return connection"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def _is_valid_response(self, response_status):"},{"line_number":173,"context_line":"        # startus is less than 400, the response is fine"},{"line_number":174,"context_line":"        if response_status \u003c httplib.BAD_REQUEST:"},{"line_number":175,"context_line":"            return True"},{"line_number":176,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvVM%3D","line":173,"updated":"2013-11-20 21:58:41.000000000","message":"startus -\u003estatus","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":202,"context_line":"    def _parse_uri(self, uri):"},{"line_number":203,"context_line":"        parts \u003d urlparse.urlparse(uri)"},{"line_number":204,"context_line":"        self.uri \u003d uri"},{"line_number":205,"context_line":"        host_port_parts \u003d parts.netloc.split(\u0027:\u0027)"},{"line_number":206,"context_line":"        self.port \u003d None"},{"line_number":207,"context_line":"        if len(host_port_parts) \u003e 1:"},{"line_number":208,"context_line":"            self.host \u003d host_port_parts[0]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvPA%3D","line":205,"updated":"2013-11-20 21:58:41.000000000","message":"You can do this instead of L205-211:\n\nself.host, sep, self.port \u003d parts.netloc.partition(\u0027:\u0027)\n\nIf no port, then self.port will be empty string vs None, so would modify other if statements, like L214.","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":209,"context_line":"            self.port \u003d host_port_parts[1]"},{"line_number":210,"context_line":"        else:"},{"line_number":211,"context_line":"            self.host \u003d host_port_parts[0]"},{"line_number":212,"context_line":"        if type(self.host).__name__ \u003d\u003d \u0027unicode\u0027:"},{"line_number":213,"context_line":"            self.host \u003d self.host.encode(\u0027ascii\u0027, \u0027ignore\u0027)"},{"line_number":214,"context_line":"        if self.port and type(self.port).__name__ \u003d\u003d \u0027unicode\u0027:"},{"line_number":215,"context_line":"            self.port \u003d self.port.encode(\u0027ascii\u0027, \u0027ignore\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvQA%3D","line":212,"updated":"2013-11-20 21:58:41.000000000","message":"Is __name__ needed here? Same on L214.\n\nCould do:\n\nif type(self.host) \u003d\u003d unicode:","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":214,"context_line":"        if self.port and type(self.port).__name__ \u003d\u003d \u0027unicode\u0027:"},{"line_number":215,"context_line":"            self.port \u003d self.port.encode(\u0027ascii\u0027, \u0027ignore\u0027)"},{"line_number":216,"context_line":"        if parts.scheme.lower() \u003d\u003d \"http\":"},{"line_number":217,"context_line":"            LOG.warn(_(\"Connection to NetScaler Control Center (NCC)\""},{"line_number":218,"context_line":"                       \"and credentials are sent in clear text \u0027http\u0027 !!\""},{"line_number":219,"context_line":"                       \" Please use \u0027https\u0027 scheme when configuring \""},{"line_number":220,"context_line":"                       \"NCC URL for stronger security.\"))"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvOw%3D","line":217,"updated":"2013-11-20 21:58:41.000000000","message":"Should add space at end of line. May want to be consistent, with space at beginning of continuation lines, or end of lines (my personal preference).","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"6fed42126b8a39f66c6810837c101d1399f32cc1","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import base64"},{"line_number":21,"context_line":"import httplib"},{"line_number":22,"context_line":"import json"},{"line_number":23,"context_line":"import sys"},{"line_number":24,"context_line":"import urlparse"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BvSw%3D","line":22,"updated":"2013-11-20 21:15:26.000000000","message":"it\u0027s better to use neutron.openstack.common.jsonutils","commit_id":"2cce9823fb6cf4df4c40a37a1ad0dfe57ebf1bb9"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"6fed42126b8a39f66c6810837c101d1399f32cc1","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            raise Exception(msg)"},{"line_number":61,"context_line":"        self._parse_uri(uri)"},{"line_number":62,"context_line":"        self.auth \u003d None"},{"line_number":63,"context_line":"        if username !\u003d None and password !\u003d None:"},{"line_number":64,"context_line":"            base64string \u003d base64.encodestring(\"%s:%s\" % (username, password))"},{"line_number":65,"context_line":"            base64string \u003d base64string[:-1]"},{"line_number":66,"context_line":"            self.auth \u003d \u0027Basic %s\u0027 % base64string"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BvT0%3D","line":63,"updated":"2013-11-20 21:15:26.000000000","message":"that should be changed to:\n if username and password:\npython automatically evaluates them as following:\n if username is not None and username !\u003d \u0027\u0027 and (the same for password)","commit_id":"2cce9823fb6cf4df4c40a37a1ad0dfe57ebf1bb9"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"6fed42126b8a39f66c6810837c101d1399f32cc1","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        except (LookupError, ImportError):"},{"line_number":87,"context_line":"            exc_type, exc_value, exc_traceback \u003d sys.exc_info()"},{"line_number":88,"context_line":"            msg \u003d _(\"Error while connecting to %(uri)s :  %(exception)s\")"},{"line_number":89,"context_line":"            LOG.error(msg % {\"uri\": self.uri,"},{"line_number":90,"context_line":"                             \"exception\": exc_type})"},{"line_number":91,"context_line":"            raise q_exc.ServiceUnavailable()"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BvSU%3D","line":89,"updated":"2013-11-20 21:15:26.000000000","message":"it\u0027s better to provide parameters to logging method instead of substituting to string:\n LOG.error(msg, {\"uri\": ...} )\n\nHere and below","commit_id":"2cce9823fb6cf4df4c40a37a1ad0dfe57ebf1bb9"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"6fed42126b8a39f66c6810837c101d1399f32cc1","unresolved":false,"context_lines":[{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def _is_valid_response(self, response_status):"},{"line_number":173,"context_line":"        # startus is less than 400, the response is fine"},{"line_number":174,"context_line":"        if response_status \u003c httplib.BAD_REQUEST:"},{"line_number":175,"context_line":"            return True"},{"line_number":176,"context_line":"        else:"},{"line_number":177,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BvSA%3D","line":174,"updated":"2013-11-20 21:15:26.000000000","message":"instead of lines 174-177 just:\n return response_status \u003c httplib.BAD_REQUEST","commit_id":"2cce9823fb6cf4df4c40a37a1ad0dfe57ebf1bb9"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"6fed42126b8a39f66c6810837c101d1399f32cc1","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        response_dict[\u0027body\u0027] \u003d response_body"},{"line_number":195,"context_line":"        response_dict[\u0027headers\u0027] \u003d response_headers"},{"line_number":196,"context_line":"        if self._is_valid_response(response_status):"},{"line_number":197,"context_line":"            if len(response_body) \u003e 0:"},{"line_number":198,"context_line":"                parsed_body \u003d self._fromjson(response_body)"},{"line_number":199,"context_line":"                response_dict[\u0027dict\u0027] \u003d parsed_body"},{"line_number":200,"context_line":"        return response_dict"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BvRs%3D","line":197,"updated":"2013-11-20 21:15:26.000000000","message":"python evaluate empty dict/empty objects to False, so:\n if response_body:","commit_id":"2cce9823fb6cf4df4c40a37a1ad0dfe57ebf1bb9"},{"author":{"_account_id":7987,"name":"Ivar Lazzaro","email":"ivarlazzaro@gmail.com","username":"Ivar"},"change_message_id":"dbef20e2f2a28fcde2314dd8e65906f8ebc254d6","unresolved":false,"context_lines":[{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":"#"},{"line_number":17,"context_line":"# @author: Youcef Laribi, Citrix"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import base64"},{"line_number":21,"context_line":"import httplib"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BdAg%3D","line":18,"updated":"2013-11-25 23:17:01.000000000","message":"nit: remove one blank line","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"class NSClient:"},{"line_number":54,"context_line":"    \"\"\"Client to operate on REST resources of NetScaler Control Center. \"\"\""},{"line_number":55,"context_line":"    def __init__(self, uri, username, password):"},{"line_number":56,"context_line":"        if not uri:"},{"line_number":57,"context_line":"            msg \u003d _(\"No NetScaler Control Center URI specified. \""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BsS4%3D","line":54,"updated":"2013-11-21 15:16:03.000000000","message":"PEP257. Blank line before and after docstring for class. Remove blank at end of string.","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            base64string \u003d base64string[:-1]"},{"line_number":66,"context_line":"            self.auth \u003d \u0027Basic %s\u0027 % base64string"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def create_resource(self, tenant_id, resource_path, object_name,"},{"line_number":69,"context_line":"                        object_data):"},{"line_number":70,"context_line":"        \"\"\"Creates an HTTP REST resource of NetScaler Control Center.\"\"\""},{"line_number":71,"context_line":"        method \u003d HTTP_CREATE_METHOD"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BsRw%3D","line":68,"updated":"2013-11-21 15:16:03.000000000","message":"Your four CRUD functions are very similar, consider refactoring and extracting common parts to a single function.","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":7987,"name":"Ivar Lazzaro","email":"ivarlazzaro@gmail.com","username":"Ivar"},"change_message_id":"dbef20e2f2a28fcde2314dd8e65906f8ebc254d6","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            response_status, resp_dict \u003d self._execute_request(method,"},{"line_number":82,"context_line":"                                                           url_path,"},{"line_number":83,"context_line":"                                                           headers,"},{"line_number":84,"context_line":"                                                           body\u003drequest_body)"},{"line_number":85,"context_line":"            return response_status, resp_dict"},{"line_number":86,"context_line":"        except (LookupError, ImportError):"},{"line_number":87,"context_line":"            exc_type, exc_value, exc_traceback \u003d sys.exc_info()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BczU%3D","line":84,"updated":"2013-11-25 23:17:01.000000000","message":"PEP-8: under-indented multi-line","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"88f956a75b58b4a0b0bc018e86b667c2f140b0b6","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                                                           headers,"},{"line_number":84,"context_line":"                                                           body\u003drequest_body)"},{"line_number":85,"context_line":"            return response_status, resp_dict"},{"line_number":86,"context_line":"        except (LookupError, ImportError):"},{"line_number":87,"context_line":"            exc_type, exc_value, exc_traceback \u003d sys.exc_info()"},{"line_number":88,"context_line":"            msg \u003d _(\"Error while connecting to %(uri)s :  %(exception)s\")"},{"line_number":89,"context_line":"            LOG.error(msg, {\"uri\": self.uri,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BqoU%3D","line":86,"updated":"2013-11-21 20:54:50.000000000","message":"Which code is throwing ImportError in the code above?","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                                                           body\u003drequest_body)"},{"line_number":85,"context_line":"            return response_status, resp_dict"},{"line_number":86,"context_line":"        except (LookupError, ImportError):"},{"line_number":87,"context_line":"            exc_type, exc_value, exc_traceback \u003d sys.exc_info()"},{"line_number":88,"context_line":"            msg \u003d _(\"Error while connecting to %(uri)s :  %(exception)s\")"},{"line_number":89,"context_line":"            LOG.error(msg, {\"uri\": self.uri,"},{"line_number":90,"context_line":"                             \"exception\": exc_type})"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Btfc%3D","line":87,"updated":"2013-11-21 09:32:35.000000000","message":"consider\n exc_type \u003d sys.exc_info()[0], here and in below methods","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"88f956a75b58b4a0b0bc018e86b667c2f140b0b6","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                                                           body\u003drequest_body)"},{"line_number":85,"context_line":"            return response_status, resp_dict"},{"line_number":86,"context_line":"        except (LookupError, ImportError):"},{"line_number":87,"context_line":"            exc_type, exc_value, exc_traceback \u003d sys.exc_info()"},{"line_number":88,"context_line":"            msg \u003d _(\"Error while connecting to %(uri)s :  %(exception)s\")"},{"line_number":89,"context_line":"            LOG.error(msg, {\"uri\": self.uri,"},{"line_number":90,"context_line":"                             \"exception\": exc_type})"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BqoQ%3D","line":87,"in_reply_to":"AAAATn%2F%2Btfc%3D","updated":"2013-11-21 20:54:50.000000000","message":"+1","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            msg \u003d _(\"Error while connecting to %(uri)s :  %(exception)s\")"},{"line_number":89,"context_line":"            LOG.error(msg, {\"uri\": self.uri,"},{"line_number":90,"context_line":"                             \"exception\": exc_type})"},{"line_number":91,"context_line":"            raise q_exc.ServiceUnavailable()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def retrieve_resource(self, tenant_id, resource_path, parse_response\u003dTrue):"},{"line_number":94,"context_line":"        \"\"\"Retrieves an HTTP REST resource of NetScaler Control Center.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BsRM%3D","line":91,"updated":"2013-11-21 15:16:03.000000000","message":"Would it be better to have a vendor specific exception and then pass in some/all of the msg? Could use that throughout this module. LInes 60,91,109,134,...","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"88f956a75b58b4a0b0bc018e86b667c2f140b0b6","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            msg \u003d _(\"Error while connecting to %(uri)s :  %(exception)s\")"},{"line_number":89,"context_line":"            LOG.error(msg, {\"uri\": self.uri,"},{"line_number":90,"context_line":"                             \"exception\": exc_type})"},{"line_number":91,"context_line":"            raise q_exc.ServiceUnavailable()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def retrieve_resource(self, tenant_id, resource_path, parse_response\u003dTrue):"},{"line_number":94,"context_line":"        \"\"\"Retrieves an HTTP REST resource of NetScaler Control Center.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BqoE%3D","line":91,"in_reply_to":"AAAATn%2F%2BsRM%3D","updated":"2013-11-21 20:54:50.000000000","message":"I think vendor-specific extension might not be required here, but ServiceUnavailable maps to 503 which is not very informative for the user","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            return response_status, resp_dict"},{"line_number":147,"context_line":"        except (LookupError, ImportError):"},{"line_number":148,"context_line":"            exc_type, exc_value, exc_traceback \u003d sys.exc_info()"},{"line_number":149,"context_line":"            msg \u003d _(\"Error while connecting to %(uri)s :  %(exception)s\")"},{"line_number":150,"context_line":"            LOG.error(msg, {\"uri\": self.uri,"},{"line_number":151,"context_line":"                             \"exception\": exc_type})"},{"line_number":152,"context_line":"            raise q_exc.ServiceUnavailable()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtfA%3D","line":149,"updated":"2013-11-21 09:32:35.000000000","message":"please add a constant for this message as it\u0027s used in several places","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":151,"context_line":"                             \"exception\": exc_type})"},{"line_number":152,"context_line":"            raise q_exc.ServiceUnavailable()"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    def _fromjson(self, payload):"},{"line_number":155,"context_line":"        \"\"\"Converts a json string into a python dictionary\"\"\""},{"line_number":156,"context_line":"        return jsonutils.loads(payload)"},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BsRU%3D","line":154,"updated":"2013-11-21 15:16:03.000000000","message":"I don\u0027t see a lot of value in the _fromjson() and _tojson() functions over just calling json.loads() and json.dumps().","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        return response_status \u003c httplib.BAD_REQUEST"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _setup_req_headers(self, tenant_id):"},{"line_number":177,"context_line":"        headers \u003d {}"},{"line_number":178,"context_line":"        headers[ACCEPT_HEADER] \u003d JSON_CONTENT_TYPE"},{"line_number":179,"context_line":"        headers[CONTENT_TYPE_HEADER] \u003d JSON_CONTENT_TYPE"},{"line_number":180,"context_line":"        headers[DRIVER_HEADER] \u003d DRIVER_HEADER_VALUE"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BsQo%3D","line":177,"updated":"2013-11-21 15:16:03.000000000","message":"Suggestion: can use alternate constructions with:\nheaders \u003d {ACCEPT_HEADER: JSON_CONTENT_TYPE,\n           CONTENT_TYPE_HEADER: JSON_CONENT_TYPE,\n          ...}\n\nSame for L189-192","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        if self._is_valid_response(response_status):"},{"line_number":194,"context_line":"            if response_body:"},{"line_number":195,"context_line":"                parsed_body \u003d self._fromjson(response_body)"},{"line_number":196,"context_line":"                response_dict[\u0027dict\u0027] \u003d parsed_body"},{"line_number":197,"context_line":"        return response_dict"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def _parse_uri(self, uri):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BsQI%3D","line":196,"updated":"2013-11-21 15:16:03.000000000","message":"can just do:\nresponse_dict[\u0027dict\u0027] \u003d jsonutil.loads(response_body)\n\nInstead of L195-196","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        self.uri \u003d uri"},{"line_number":202,"context_line":"        host_port_parts \u003d parts.netloc.split(\u0027:\u0027)"},{"line_number":203,"context_line":"        self.port \u003d None"},{"line_number":204,"context_line":"        if len(host_port_parts) \u003e 1:"},{"line_number":205,"context_line":"            self.host \u003d host_port_parts[0]"},{"line_number":206,"context_line":"            self.port \u003d host_port_parts[1]"},{"line_number":207,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BsP4%3D","line":204,"updated":"2013-11-21 15:16:03.000000000","message":"As mentioned in changeset 1, can use str.partition() instead of L202-208. Just need to change later tests to check for empty string vs None.","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":7987,"name":"Ivar Lazzaro","email":"ivarlazzaro@gmail.com","username":"Ivar"},"change_message_id":"dbef20e2f2a28fcde2314dd8e65906f8ebc254d6","unresolved":false,"context_lines":[{"line_number":236,"context_line":"            LOG.debug(_(\"Response: %s\"), resp_dict[\u0027body\u0027])"},{"line_number":237,"context_line":"            response_status \u003d resp_dict[\u0027status\u0027]"},{"line_number":238,"context_line":"            if str(response_status) \u003d\u003d HTTP_AUTH_FAILURE_STATUSCODE:"},{"line_number":239,"context_line":"                LOG.error(_(\"Unable to login.Invalid credentials passed \""},{"line_number":240,"context_line":"                            \"for host: %s.\"), self.host)"},{"line_number":241,"context_line":"                raise q_exc.ServiceUnavailable()"},{"line_number":242,"context_line":"            if not self._is_valid_response(response_status):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BcvQ%3D","line":239,"updated":"2013-11-25 23:17:01.000000000","message":"nit: space after dot.","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":39,"context_line":"HTTPS_SCHEME \u003d \u0027https\u0027"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class NCCException(Exception):"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    \"\"\"Represents exceptions thrown by NSClient.\"\"\""},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BaeQ%3D","line":42,"updated":"2013-11-26 11:50:27.000000000","message":"Consider deriving from NeitronException","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        \"\"\"Removes an HTTP REST resource of NetScaler Control Center.\"\"\""},{"line_number":95,"context_line":"        return self._do_resource(\u0027DELETE\u0027, tenant_id, resource_path)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def _do_resource(self, method, tenant_id, resource_path,"},{"line_number":98,"context_line":"                     object_name\u003dNone, object_data\u003dNone):"},{"line_number":99,"context_line":"        url_path \u003d self.service_path + \"/\" + resource_path"},{"line_number":100,"context_line":"        headers \u003d self._setup_req_headers(tenant_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BadM%3D","line":97,"updated":"2013-11-26 11:50:27.000000000","message":"nit: consider _resource_operation or _resource_action","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"07fcbd7417649b5d81f7d3727d86a23112a0d729","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            connection \u003d httplib.HTTPSConnection(self.host, self.port)"},{"line_number":120,"context_line":"        else:"},{"line_number":121,"context_line":"            LOG.error(_(\"protocol unrecognized:%s\"), self.protocol)"},{"line_number":122,"context_line":"            error \u003d NCCException.CONNECTION_ERROR"},{"line_number":123,"context_line":"            raise NCCException(error)"},{"line_number":124,"context_line":"        return connection"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BZ%2BM%3D","line":122,"updated":"2013-11-26 13:25:57.000000000","message":"Didn\u0027t look up the definition, but is error temp variable useful here and L188, L196, L204?","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"07fcbd7417649b5d81f7d3727d86a23112a0d729","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            self.port \u003d self.port.encode(\u0027ascii\u0027, \u0027ignore\u0027)"},{"line_number":159,"context_line":"        if parts.scheme.lower() \u003d\u003d \"http\":"},{"line_number":160,"context_line":"            warning_msg \u003d _(\"Connection to NetScaler Control Center (NCC)\""},{"line_number":161,"context_line":"                       \"and credentials are sent in clear text \u0027http\u0027 !!\""},{"line_number":162,"context_line":"                       \" Please use \u0027https\u0027 scheme when configuring\""},{"line_number":163,"context_line":"                       \" NCC URL for stronger security.\")"},{"line_number":164,"context_line":"            LOG.warn(warning_msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BZ%2Fs%3D","line":161,"updated":"2013-11-26 13:25:57.000000000","message":"need space before \u0027and\u0027. Could remove space before !!","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"3c6a44394c5c4ca2283a6d73453c0bc7df0ec64e","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        else:"},{"line_number":121,"context_line":"            LOG.error(_(\"protocol unrecognized:%s\"), self.protocol)"},{"line_number":122,"context_line":"            error \u003d NCCException.CONNECTION_ERROR"},{"line_number":123,"context_line":"            raise NCCException(error)"},{"line_number":124,"context_line":"        return connection"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def _is_valid_response(self, response_status):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2BG98%3D","line":123,"updated":"2013-12-02 14:54:03.000000000","message":"raise NCCException(NCCExceptoion.CONNECTION_ERROR)","commit_id":"2ea95a4b563252810135864ee5e6d779e880c95b"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2013 Citrix Systems"},{"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":12,"id":"AAAAUH%2F%2FYcY%3D","line":3,"updated":"2014-01-14 12:23:20.000000000","message":"2014","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        self.error \u003d error"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"class NSClient:"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    \"\"\"Client to operate on REST resources of NetScaler Control Center.\"\"\""},{"line_number":59,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F%2FYcM%3D","line":56,"updated":"2014-01-14 12:23:20.000000000","message":"New style class?\n\nclass NSClient(object):","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        response_status \u003d response.status"},{"line_number":139,"context_line":"        response_body \u003d response.read()"},{"line_number":140,"context_line":"        response_headers \u003d response.getheaders()"},{"line_number":141,"context_line":"        response_dict \u003d {}"},{"line_number":142,"context_line":"        response_dict[\u0027status\u0027] \u003d response_status"},{"line_number":143,"context_line":"        response_dict[\u0027body\u0027] \u003d response_body"},{"line_number":144,"context_line":"        response_dict[\u0027headers\u0027] \u003d response_headers"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F%2FYaY%3D","line":141,"updated":"2014-01-14 12:23:20.000000000","message":"Could be more succinct with:\n\nresponse_dict \u003d {\u0027status\u0027: response_status,\n                 \u0027body\u0027: response_body,\n                 \u0027headers\u0027: response_headers}","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"fdf275d838bf33ce8e44a717f336cd1bb1824582","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import sys"},{"line_number":22,"context_line":"import urlparse"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from neutron.common.exceptions import NeutronException"},{"line_number":25,"context_line":"from neutron.openstack.common import jsonutils"},{"line_number":26,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Bj1k%3D","line":24,"updated":"2014-01-24 12:21:09.000000000","message":"nit: use module-level imports:\n from neutron.common import exceptions as n_exc","commit_id":"ee9edd941c059b2c61ef8ca463556d1811799158"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"fdf275d838bf33ce8e44a717f336cd1bb1824582","unresolved":false,"context_lines":[{"line_number":39,"context_line":"HTTPS_SCHEME \u003d \u0027https\u0027"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class NCCException(NeutronException):"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    \"\"\"Represents exceptions thrown by NSClient.\"\"\""},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Bj0k%3D","line":42,"updated":"2014-01-24 12:21:09.000000000","message":"per comment above:\n class NCCException(n_exc.NeutronException):","commit_id":"ee9edd941c059b2c61ef8ca463556d1811799158"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":17,"context_line":"# @author: Youcef Laribi, Citrix"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import base64"},{"line_number":20,"context_line":"import httplib"},{"line_number":21,"context_line":"import sys"},{"line_number":22,"context_line":"import urlparse"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97fU%3D","line":20,"updated":"2014-01-31 23:45:39.000000000","message":"You\u0027re actually making this harder on yourself.  Why not a better library for http?  requests is already a dependency of Neutron.","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        if type(self.host) \u003d\u003d unicode:"},{"line_number":154,"context_line":"            self.host \u003d self.host.encode(\u0027ascii\u0027, \u0027ignore\u0027)"},{"line_number":155,"context_line":"        if self.port and type(self.port) \u003d\u003d unicode:"},{"line_number":156,"context_line":"            self.port \u003d self.port.encode(\u0027ascii\u0027, \u0027ignore\u0027)"},{"line_number":157,"context_line":"        if parts.scheme.lower() \u003d\u003d \"http\":"},{"line_number":158,"context_line":"            warning_msg \u003d _(\"Connection to NetScaler Control Center (NCC) \""},{"line_number":159,"context_line":"                            \"and credentials are sent in clear text \u0027http\u0027!! \""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97fA%3D","line":156,"updated":"2014-01-31 23:45:39.000000000","message":"Why not convert this to a int?","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            connection.request(method, url_path, headers\u003dheaders, body\u003dbody)"},{"line_number":179,"context_line":"            response \u003d connection.getresponse()"},{"line_number":180,"context_line":"            connection.close()"},{"line_number":181,"context_line":"        except Exception:"},{"line_number":182,"context_line":"            exc_type \u003d sys.exc_info()[0]"},{"line_number":183,"context_line":"            msg \u003d _(\"Error while connecting to %(uri)s :  %(exception)s\")"},{"line_number":184,"context_line":"            LOG.error(msg, {\"uri\": self.uri,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97ck%3D","line":181,"updated":"2014-01-31 23:45:39.000000000","message":"Not sure why you are directly using exc_info yourself. Consider using:\n\nLOG.exception(\u0027my message\u0027)","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2014 Citrix Systems"},{"line_number":4,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqyw%3D","line":1,"updated":"2014-02-19 22:48:08.000000000","message":"It looks like there\u0027s the sentiment of removing these lines. Since this is a new file, please consider omitting it to avoid causing longer sweeping patches later.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":"#"},{"line_number":17,"context_line":"# @author: Youcef Laribi, Citrix"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import base64"},{"line_number":20,"context_line":"import requests"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqxo%3D","line":17,"updated":"2014-02-19 22:48:08.000000000","message":"I appreciate these lines might be added automatically by some editors...I personally find them superfluous because authors can be tracked differently. Also, this do not pay justice to other people who contribute to this file in the future and forget to add themselves to the list. Please, consider removing it.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    \"\"\"Represents exceptions thrown by NSClient.\"\"\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    CONNECTION_ERROR \u003d 1"},{"line_number":42,"context_line":"    REQUEST_ERROR \u003d 2"},{"line_number":43,"context_line":"    RESPONSE_ERROR \u003d 3"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqlA%3D","line":41,"updated":"2014-02-19 22:48:08.000000000","message":"I wonder if these buckets are too restrictive. RESPONSE_ERROR is returned when unauthorized or when the response status is (in general greater or equal than 400). I think a developer might have a hard time digging what\u0027s really happened. Please consider providing more troubleshooting information in this exception.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        if not service_uri:"},{"line_number":57,"context_line":"            msg \u003d _(\"No NetScaler Control Center URI specified. \""},{"line_number":58,"context_line":"                    \"Cannot connect.\")"},{"line_number":59,"context_line":"            LOG.error(msg)"},{"line_number":60,"context_line":"            raise NCCException(NCCException.CONNECTION_ERROR)"},{"line_number":61,"context_line":"        self.service_uri \u003d service_uri.strip(\u0027/\u0027)"},{"line_number":62,"context_line":"        self.auth \u003d None"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqwQ%3D","line":59,"updated":"2014-02-19 22:48:08.000000000","message":"you\u0027d probably want to raise the log level to exception here. Just a suggestion.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"d3409b7caaa5b03e3f496ece56ad18af45b65521","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        if not service_uri:"},{"line_number":57,"context_line":"            msg \u003d _(\"No NetScaler Control Center URI specified. \""},{"line_number":58,"context_line":"                    \"Cannot connect.\")"},{"line_number":59,"context_line":"            LOG.error(msg)"},{"line_number":60,"context_line":"            raise NCCException(NCCException.CONNECTION_ERROR)"},{"line_number":61,"context_line":"        self.service_uri \u003d service_uri.strip(\u0027/\u0027)"},{"line_number":62,"context_line":"        self.auth \u003d None"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BoLA%3D","line":59,"in_reply_to":"AAAAUX%2F%2BqwQ%3D","updated":"2014-02-20 05:27:07.000000000","message":"i think the exception level is appropriate when there is exception context in the block. Anyway exception will be logged on up the stack chain","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def create_resource(self, tenant_id, resource_path, object_name,"},{"line_number":69,"context_line":"                        object_data):"},{"line_number":70,"context_line":"        \"\"\"Creates an HTTP REST resource of NetScaler Control Center.\"\"\""},{"line_number":71,"context_line":"        return self._resource_operation(\u0027POST\u0027, tenant_id,"},{"line_number":72,"context_line":"                                        resource_path,"},{"line_number":73,"context_line":"                                        object_name\u003dobject_name,"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqsE%3D","line":70,"updated":"2014-02-19 22:48:08.000000000","message":"Suggestion (same for below): docstring usually dictate what a method/class does without using the third person, so here it would be:\n\n\"\"\"Create a resource of NetScaler Control Center\"\"\"\n\nIn this case I would also omit HTTP and REST, they seem rather implementation specific, when the method name is not.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4da72d153a9cc5b2aed231701f293e97375481a6","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def _resource_operation(self, method, tenant_id, resource_path,"},{"line_number":93,"context_line":"                            object_name\u003dNone, object_data\u003dNone):"},{"line_number":94,"context_line":"        resource_uri \u003d self.service_uri + \"/\" + resource_path"},{"line_number":95,"context_line":"        headers \u003d self._setup_req_headers(tenant_id)"},{"line_number":96,"context_line":"        request_body \u003d None"},{"line_number":97,"context_line":"        if object_data:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FW1A%3D","line":94,"updated":"2014-02-13 19:13:22.000000000","message":"nit: it\u0027s better to write \n resource_uri \u003d \"%s/%s\" % (self.service_uri, resource_path)","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def _resource_operation(self, method, tenant_id, resource_path,"},{"line_number":93,"context_line":"                            object_name\u003dNone, object_data\u003dNone):"},{"line_number":94,"context_line":"        resource_uri \u003d self.service_uri + \"/\" + resource_path"},{"line_number":95,"context_line":"        headers \u003d self._setup_req_headers(tenant_id)"},{"line_number":96,"context_line":"        request_body \u003d None"},{"line_number":97,"context_line":"        if object_data:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqrQ%3D","line":94,"in_reply_to":"AAAAUX%2F%2FW1A%3D","updated":"2014-02-19 22:48:08.000000000","message":"I concur; I have seen this stylistic comments posted/addressed in the past, so please consider using a more pythonic way of concatenating strings.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        try:"},{"line_number":133,"context_line":"            response \u003d requests.request(method, url\u003dresource_uri,"},{"line_number":134,"context_line":"                                        headers\u003dheaders, data\u003dbody)"},{"line_number":135,"context_line":"        except Exception:"},{"line_number":136,"context_line":"            msg \u003d _(\"Error while connecting to %(uri)s\")"},{"line_number":137,"context_line":"            LOG.exception(msg, {\"uri\": self.service_uri})"},{"line_number":138,"context_line":"            raise NCCException(NCCException.CONNECTION_ERROR)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqpY%3D","line":135,"updated":"2014-02-19 22:48:08.000000000","message":"I am against such broad exception statements, especially if there is no recovery from them. Do you mean to catch runtime exceptions, like timeouts, 500 errors etc? If you have a syntax here, why would you report it as a connection error? I think it is misleading. Please consider catching all the exception you care about here and leave everything else to the caller.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            response \u003d requests.request(method, url\u003dresource_uri,"},{"line_number":134,"context_line":"                                        headers\u003dheaders, data\u003dbody)"},{"line_number":135,"context_line":"        except Exception:"},{"line_number":136,"context_line":"            msg \u003d _(\"Error while connecting to %(uri)s\")"},{"line_number":137,"context_line":"            LOG.exception(msg, {\"uri\": self.service_uri})"},{"line_number":138,"context_line":"            raise NCCException(NCCException.CONNECTION_ERROR)"},{"line_number":139,"context_line":"        resp_dict \u003d self._get_response_dict(response)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqpo%3D","line":136,"updated":"2014-02-19 22:48:08.000000000","message":"usually the substitution occurs at the time of the message definition. Also being uri the only paramenter this can be written like so:\n\nmsg \u003d _(\"Error while connecting to %s\") % self.service_uri\nLOG.exception(msg)","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        resp_dict \u003d self._get_response_dict(response)"},{"line_number":140,"context_line":"        LOG.debug(_(\"Response: %s\"), resp_dict[\u0027body\u0027])"},{"line_number":141,"context_line":"        response_status \u003d resp_dict[\u0027status\u0027]"},{"line_number":142,"context_line":"        if str(response_status) \u003d\u003d requests.codes.unauthorized:"},{"line_number":143,"context_line":"            LOG.error(_(\"Unable to login. Invalid credentials passed.\""},{"line_number":144,"context_line":"                      \"for host: %s.\"), self.host)"},{"line_number":145,"context_line":"            raise NCCException(NCCException.RESPONSE_ERROR)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqmQ%3D","line":142,"updated":"2014-02-19 22:48:08.000000000","message":"as far as I can tell requests.codes are integer (in fact you treat them as such on line 112) . Why are you converting response_status to a string?","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":144,"context_line":"                      \"for host: %s.\"), self.host)"},{"line_number":145,"context_line":"            raise NCCException(NCCException.RESPONSE_ERROR)"},{"line_number":146,"context_line":"        if not self._is_valid_response(response_status):"},{"line_number":147,"context_line":"            msg \u003d _(\"Failed %(method)s operation on %(url)s \""},{"line_number":148,"context_line":"                    \"status code: %(response_status)s\")"},{"line_number":149,"context_line":"            LOG.error(msg, {\"method\": method,"},{"line_number":150,"context_line":"                            \"url\": resource_uri,"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqlw%3D","line":147,"updated":"2014-02-19 22:48:08.000000000","message":"see comment line 136","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"}],"neutron/services/loadbalancer/drivers/netscaler/netscaler_driver.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        network_info \u003d self._get_vip_network_info(context, vip)"},{"line_number":78,"context_line":"        self._prepare_vip_for_creation(vip)"},{"line_number":79,"context_line":"        vip \u003d dict(vip.items() + network_info.items())"},{"line_number":80,"context_line":"        LOG.debug(_(\"NetScaler driver vip creation: %s\") % repr(vip))"},{"line_number":81,"context_line":"        self.client.create_resource(context.tenant_id, VIPS_RESOURCE,"},{"line_number":82,"context_line":"                                    VIP_RESOURCE, vip)"},{"line_number":83,"context_line":"        self._set_vip_status(context, vip, constants.ACTIVE)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvOQ%3D","line":80,"updated":"2013-11-20 21:58:41.000000000","message":"For the logs, use comma for arg vs %:\n\nLOG.debug(_(\"NetScaler driver vip creation: %s\"), repr(vip))\n\nSame for rest of logs in this file...","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def update_vip(self, context, old_vip, vip):"},{"line_number":86,"context_line":"        \"\"\"Updates a vip on a NetScaler device.\"\"\""},{"line_number":87,"context_line":"        update_vip \u003d self._prepare_vip_for_update(vip)"},{"line_number":88,"context_line":"        LOG.debug(_(\"NetScaler driver vip %s update: %s\") % (vip[\"id\"],"},{"line_number":89,"context_line":"                  repr(vip)))"},{"line_number":90,"context_line":"        resource_path \u003d \"%s/%s\" % (VIPS_RESOURCE, vip[\"id\"])"},{"line_number":91,"context_line":"        self.client.update_resource(context.tenant_id, resource_path,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvNc%3D","line":88,"updated":"2013-11-20 21:58:41.000000000","message":"When \u003e1 argument, use a dictionary:\n\nLOG.debug(_(\"NetScaler driver vip %(id)s update: %(vip)s\"), {vip[\"id\"], repr(vip)})\n\n(you can pick better names than id and vip that I did :)","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        del vip[\"port_id\"]"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def _prepare_vip_for_update(self, vip):"},{"line_number":227,"context_line":"        update_vip \u003d {}"},{"line_number":228,"context_line":"        update_vip[\u0027name\u0027] \u003d vip[\u0027name\u0027]"},{"line_number":229,"context_line":"        update_vip[\u0027description\u0027] \u003d vip[\u0027description\u0027]"},{"line_number":230,"context_line":"        update_vip[\u0027pool_id\u0027] \u003d vip[\u0027pool_id\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvMw%3D","line":227,"updated":"2013-11-20 21:58:41.000000000","message":"Could do:\nreturn {\u0027name\u0027 vip[\u0027name\u0027],\n        \u0027description\u0027: vip[\u0027description\u0027],\n        ...","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":329,"context_line":"                     subnet_id)"},{"line_number":330,"context_line":"            return ports[0]"},{"line_number":331,"context_line":"        LOG.info(_(\"Found no SNAT ports for subnet %s\") % subnet_id)"},{"line_number":332,"context_line":"        return None"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"    def _create_snatport_for_subnet(self, context, tenant_id, subnet_id,"},{"line_number":335,"context_line":"                                    ip_address):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvMg%3D","line":332,"updated":"2013-11-20 21:58:41.000000000","message":"Not needed.","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2013 New Dream Network, LLC (DreamHost)"},{"line_number":4,"context_line":"# Copyright 2013 Citrix Systems, Inc."},{"line_number":5,"context_line":"#"},{"line_number":6,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtZ0%3D","line":3,"updated":"2013-11-21 09:32:35.000000000","message":"New Dream Network left by mistake I believe","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":7987,"name":"Ivar Lazzaro","email":"ivarlazzaro@gmail.com","username":"Ivar"},"change_message_id":"dbef20e2f2a28fcde2314dd8e65906f8ebc254d6","unresolved":false,"context_lines":[{"line_number":17,"context_line":"#"},{"line_number":18,"context_line":"# @author: Youcef Laribi, Citrix"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from oslo.config import cfg"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from neutron.api.v2 import attributes"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Bc%2Bs%3D","line":20,"updated":"2013-11-25 23:17:01.000000000","message":"nit: remove 1 blank line","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":7987,"name":"Ivar Lazzaro","email":"ivarlazzaro@gmail.com","username":"Ivar"},"change_message_id":"dbef20e2f2a28fcde2314dd8e65906f8ebc254d6","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class NetScalerPluginDriver(abstract_driver.LoadBalancerAbstractDriver):"},{"line_number":64,"context_line":"    \"\"\" NetScaler LBaaS Plugin driver class.\"\"\""},{"line_number":65,"context_line":"    def __init__(self, plugin):"},{"line_number":66,"context_line":"        self.plugin \u003d plugin"},{"line_number":67,"context_line":"        self.pool_to_port_id \u003d {}"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Bcu0%3D","line":64,"updated":"2013-11-25 23:17:01.000000000","message":"blank line before and after class docstring, remove space as first character","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"88f956a75b58b4a0b0bc018e86b667c2f140b0b6","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        vip \u003d dict(vip.items() + network_info.items())"},{"line_number":80,"context_line":"        msg \u003d _(\"NetScaler driver vip creation: %(vip_obj)s\")"},{"line_number":81,"context_line":"        LOG.debug(msg, {\"vip_obj\": repr(vip)})"},{"line_number":82,"context_line":"        self.client.create_resource(context.tenant_id, VIPS_RESOURCE,"},{"line_number":83,"context_line":"                                    VIP_RESOURCE, vip)"},{"line_number":84,"context_line":"        self._set_vip_status(context, vip, constants.ACTIVE)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Bqno%3D","line":82,"updated":"2013-11-21 20:54:50.000000000","message":"Exception from the client should be caught here and vip status set accordingly (depending on result).","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"88f956a75b58b4a0b0bc018e86b667c2f140b0b6","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                                    VIP_RESOURCE, vip)"},{"line_number":84,"context_line":"        self._set_vip_status(context, vip, constants.ACTIVE)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def update_vip(self, context, old_vip, vip):"},{"line_number":87,"context_line":"        \"\"\"Updates a vip on a NetScaler device.\"\"\""},{"line_number":88,"context_line":"        update_vip \u003d self._prepare_vip_for_update(vip)"},{"line_number":89,"context_line":"        resource_path \u003d \"%s/%s\" % (VIPS_RESOURCE, vip[\"id\"])"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BqiY%3D","line":86,"updated":"2013-11-21 20:54:50.000000000","message":"I also would like to see the following problem addressed:\ncurrently we have resource status, which is in fact, deployment status, and admin_state_up.\nThose properties should be consistent. E.g., if, say, change admin_state_up from True (default) to False, resource[\u0027status\u0027] can change.\nI\u0027d like to know how it will be for your driver.","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"88f956a75b58b4a0b0bc018e86b667c2f140b0b6","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        resource_path \u003d \"%s/%s\" % (VIPS_RESOURCE, vip[\"id\"])"},{"line_number":90,"context_line":"        msg \u003d _(\"NetScaler driver vip %(vip_id)s update: %(vip_obj)s\")"},{"line_number":91,"context_line":"        LOG.debug(msg, {\"vip_id\": vip[\"id\"], \"vip_obj\": repr(vip)})"},{"line_number":92,"context_line":"        self.client.update_resource(context.tenant_id, resource_path,"},{"line_number":93,"context_line":"                                    VIP_RESOURCE, update_vip)"},{"line_number":94,"context_line":"        self._set_vip_status(context, old_vip, constants.ACTIVE)"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Bqik%3D","line":92,"updated":"2013-11-21 20:54:50.000000000","message":"same as above.","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"88f956a75b58b4a0b0bc018e86b667c2f140b0b6","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def update_pool(self, context, old_pool, pool):"},{"line_number":121,"context_line":"        \"\"\"Updates a pool on a NetScaler device.\"\"\""},{"line_number":122,"context_line":"        if pool[\u0027subnet_id\u0027] !\u003d old_pool[\u0027subnet_id\u0027]:"},{"line_number":123,"context_line":"            # if this is the first pool using the new subnet,"},{"line_number":124,"context_line":"            # then add a snat port/ipaddress to it."},{"line_number":125,"context_line":"            network_info \u003d self._get_pool_network_info(context, pool)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BqhQ%3D","line":122,"updated":"2013-11-21 20:54:50.000000000","message":"that case is not possible: it is specified by loadbalancer extension (line 159, \u0027allow_put\u0027: False, which means that subnet_id can\u0027t be updated). Also I think that operations doesn\u0027t make much sense from user perspective since it would make attached members unreachable","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":229,"context_line":"        resource_path \u003d \"%s/%s\" % (POOLSTATS_RESOURCE, pool_id)"},{"line_number":230,"context_line":"        msg \u003d _(\"NetScaler driver pool stats retrieval: %(pool_id)s\")"},{"line_number":231,"context_line":"        LOG.debug(msg, {\"pool_id\": pool_id})"},{"line_number":232,"context_line":"        status, stats \u003d self.client.retrieve_resource(context.tenant_id,"},{"line_number":233,"context_line":"                                                      resource_path)"},{"line_number":234,"context_line":"        return stats"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtcE%3D","line":232,"updated":"2013-11-21 09:32:35.000000000","message":"is status needed?","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        LOG.debug(msg, {\"pool_id\": pool_id})"},{"line_number":232,"context_line":"        status, stats \u003d self.client.retrieve_resource(context.tenant_id,"},{"line_number":233,"context_line":"                                                      resource_path)"},{"line_number":234,"context_line":"        return stats"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _prepare_vip_for_creation(self, vip):"},{"line_number":237,"context_line":"        del vip[\"status\"]"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtcI%3D","line":234,"updated":"2013-11-21 09:32:35.000000000","message":"what is the format of stats here?","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"88f956a75b58b4a0b0bc018e86b667c2f140b0b6","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        return stats"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _prepare_vip_for_creation(self, vip):"},{"line_number":237,"context_line":"        del vip[\"status\"]"},{"line_number":238,"context_line":"        del vip[\"status_description\"]"},{"line_number":239,"context_line":"        del vip[\"port_id\"]"},{"line_number":240,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BqfI%3D","line":237,"updated":"2013-11-21 20:54:50.000000000","message":"i\u0027d suggest to copy needed fields from one dict to another.\nAlso applies to code below.\nThat is a common way it\u0027s done in neutron.","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":295,"context_line":"        network_id \u003d subnet[\u0027network_id\u0027]"},{"line_number":296,"context_line":"        network \u003d self.plugin._core_plugin.get_network(context, network_id)"},{"line_number":297,"context_line":"        network_info[\u0027port_id\u0027] \u003d vip[\u0027port_id\u0027]"},{"line_number":298,"context_line":"        network_info[\u0027network_id\u0027] \u003d subnet[\u0027network_id\u0027]"},{"line_number":299,"context_line":"        network_info[\u0027subnet_id\u0027] \u003d subnet_id"},{"line_number":300,"context_line":"        if PROV_NET_TYPE in network:"},{"line_number":301,"context_line":"            network_info[\u0027network_type\u0027] \u003d network[PROV_NET_TYPE]"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Btbk%3D","line":298,"updated":"2013-11-21 09:32:35.000000000","message":"nit: can use network_id","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":303,"context_line":"            network_info[\u0027segmentation_id\u0027] \u003d network[PROV_SEGMT_ID]"},{"line_number":304,"context_line":"        return network_info"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def _get_pool_network_info(self, context, pool):"},{"line_number":307,"context_line":"        network_info \u003d {}"},{"line_number":308,"context_line":"        subnet_id \u003d pool[\u0027subnet_id\u0027]"},{"line_number":309,"context_line":"        subnet \u003d self.plugin._core_plugin.get_subnet(context, subnet_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Bta4%3D","line":306,"updated":"2013-11-21 09:32:35.000000000","message":"consider refactor this and above methods to one method which accepts subnet_id as a parameter","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":400,"context_line":"                    \"as it is the last pool using it...\")"},{"line_number":401,"context_line":"            LOG.info(msg, {\"subnet_id\": subnet_id})"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"    def _set_vip_status(self, context, vip, status):"},{"line_number":404,"context_line":"        vip[\u0027status\u0027] \u003d status"},{"line_number":405,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":406,"context_line":"            qry \u003d context.session.query(loadbalancer_db.Vip)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtaU%3D","line":403,"updated":"2013-11-21 09:32:35.000000000","message":"please use self.plugin.update_status() instead of below 4 methods","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":25,"context_line":"from neutron.plugins.common import constants"},{"line_number":26,"context_line":"from neutron.services.loadbalancer.drivers import abstract_driver"},{"line_number":27,"context_line":"from neutron.services.loadbalancer.drivers.netscaler.ncc_client import ("},{"line_number":28,"context_line":"      NSClient, NCCException)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2Bab8%3D","line":27,"updated":"2013-11-26 11:50:27.000000000","message":"please use module level imports:\n from neutron.services.loadbalancer.drivers.netscaler import ncc_client","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            self._set_status(context, loadbalancer_db.Vip,"},{"line_number":106,"context_line":"                             old_vip, old_vip[\"id\"],"},{"line_number":107,"context_line":"                             constants.ERROR)"},{"line_number":108,"context_line":"            #propagate the exception up the stack"},{"line_number":109,"context_line":"            raise"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            self._set_status(context, loadbalancer_db.Vip,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2Baac%3D","line":108,"updated":"2013-11-26 11:50:27.000000000","message":"why only in case of update_vip?","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        msg \u003d _(\"NetScaler driver pool stats retrieval: %(pool_id)s\")"},{"line_number":306,"context_line":"        LOG.debug(msg, {\"pool_id\": pool_id})"},{"line_number":307,"context_line":"        try:"},{"line_number":308,"context_line":"            _, stats \u003d self.client.retrieve_resource(context.tenant_id,"},{"line_number":309,"context_line":"                                                     resource_path)"},{"line_number":310,"context_line":"        except NCCException:"},{"line_number":311,"context_line":"            self._set_status(context, loadbalancer_db.Pool,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BaZQ%3D","line":308,"updated":"2013-11-26 11:50:27.000000000","message":"please don\u0027t mask the i8n function _. Consider:\n stats \u003d ...[1]","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":511,"context_line":"                    \"as it is the last pool using it...\")"},{"line_number":512,"context_line":"            LOG.info(msg, {\"subnet_id\": subnet_id})"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"    def _set_status(self, context, model, entity, entity_id, status):"},{"line_number":515,"context_line":"        self.plugin.update_status(context, model, entity_id, status)"},{"line_number":516,"context_line":""},{"line_number":517,"context_line":"    def _set_poolhealthmonitor_status(self, context, monitor, pool_id, status):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BaYA%3D","line":514,"updated":"2013-11-26 11:50:27.000000000","message":"this method seems redundant: can use self.plugin.update_status() where needed.","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2013 Citrix Systems, Inc."},{"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":12,"id":"AAAAUH%2F%2FYaI%3D","line":3,"updated":"2014-01-14 12:23:20.000000000","message":"copyright date.","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":310,"context_line":"        ncc_vip \u003d {"},{"line_number":311,"context_line":"            \u0027id\u0027: vip[\u0027id\u0027],"},{"line_number":312,"context_line":"            \u0027tenant_id\u0027: vip[\u0027tenant_id\u0027],"},{"line_number":313,"context_line":"            \u0027name\u0027: vip[\u0027name\u0027],"},{"line_number":314,"context_line":"            \u0027description\u0027: vip[\u0027description\u0027],"},{"line_number":315,"context_line":"            \u0027pool_id\u0027: vip[\u0027pool_id\u0027],"},{"line_number":316,"context_line":"            \u0027protocol\u0027: vip[\u0027protocol\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F%2FYYY%3D","line":313,"updated":"2014-01-14 12:23:20.000000000","message":"Since there are several entries in common between create and update, you could consider eliminating duplication:\n\nncc_vip \u003d {\u0027id\u0027: vip[\u0027id\u0027], \u0027protocol\u0027: vip[\u0027protocol\u0027],...}\nncc_vip.update(self._prepare_vip_for_update(vip))\nreturn ncc_vip\n\nSame for pool, member, and health monitor code blocks. Lots of duplication.","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"fdf275d838bf33ce8e44a717f336cd1bb1824582","unresolved":false,"context_lines":[{"line_number":491,"context_line":"                    \"as it is the last pool using it...\")"},{"line_number":492,"context_line":"            LOG.info(msg, {\"subnet_id\": subnet_id})"},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"    def _set_poolhealthmonitor_status(self, context, monitor, pool_id, status):"},{"line_number":495,"context_line":"        # Cannot use self.plugin.update_status() here since a"},{"line_number":496,"context_line":"        # PoolHealthMonitorAssociation takes 2 ids (pool_id and monitor_id)"},{"line_number":497,"context_line":"        # while update_status() assumes a resource is identified by one ID,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Bjr4%3D","line":494,"updated":"2014-01-24 12:21:09.000000000","message":"please use loadbalancer_db.LoadbalancerDBPlugin.update_pool_health_monitor()","commit_id":"ee9edd941c059b2c61ef8ca463556d1811799158"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":431,"context_line":"                \"tenant_id\u003d%(tenant_id)s, name\u003d%(name)s\")"},{"line_number":432,"context_line":"        LOG.debug(msg, {\u0027network_id\u0027: network_id,"},{"line_number":433,"context_line":"                        \u0027tenant_id\u0027: tenant_id,"},{"line_number":434,"context_line":"                        \u0027name\u0027: name})"},{"line_number":435,"context_line":"        filter_dict \u003d {"},{"line_number":436,"context_line":"            \u0027network_id\u0027: [network_id],"},{"line_number":437,"context_line":"            \u0027tenant_id\u0027: [tenant_id],"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97b8%3D","line":434,"updated":"2014-01-31 23:45:39.000000000","message":"name is a really weak search identifier (can be modified easily by tenant).  Should use device_owner and possibly device_id.","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2014 Citrix Systems, Inc."},{"line_number":4,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqk4%3D","line":1,"updated":"2014-02-19 22:48:08.000000000","message":"ditto","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":"#"},{"line_number":17,"context_line":"# @author: Youcef Laribi, Citrix"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo.config import cfg"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqk0%3D","line":17,"updated":"2014-02-19 22:48:08.000000000","message":"ditto","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":30,"context_line":"NETSCALER_CC_OPTS \u003d ["},{"line_number":31,"context_line":"    cfg.StrOpt("},{"line_number":32,"context_line":"        \u0027netscaler_ncc_uri\u0027,"},{"line_number":33,"context_line":"        help\u003d_(\u0027The URL to reach the NetScaler Control Center Server\u0027),"},{"line_number":34,"context_line":"    ),"},{"line_number":35,"context_line":"    cfg.StrOpt("},{"line_number":36,"context_line":"        \u0027netscaler_ncc_username\u0027,"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqkw%3D","line":33,"updated":"2014-02-19 22:48:08.000000000","message":"small nit: ending with a trailing period?","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    ),"},{"line_number":35,"context_line":"    cfg.StrOpt("},{"line_number":36,"context_line":"        \u0027netscaler_ncc_username\u0027,"},{"line_number":37,"context_line":"        help\u003d_(\u0027Username to login to the NetScaler Control Center Server\u0027),"},{"line_number":38,"context_line":"    ),"},{"line_number":39,"context_line":"    cfg.StrOpt("},{"line_number":40,"context_line":"        \u0027netscaler_ncc_password\u0027,"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqkk%3D","line":37,"updated":"2014-02-19 22:48:08.000000000","message":"here","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    ),"},{"line_number":39,"context_line":"    cfg.StrOpt("},{"line_number":40,"context_line":"        \u0027netscaler_ncc_password\u0027,"},{"line_number":41,"context_line":"        help\u003d_(\u0027Password to login to the NetScaler Control Center Server\u0027),"},{"line_number":42,"context_line":"    )"},{"line_number":43,"context_line":"]"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqkg%3D","line":41,"updated":"2014-02-19 22:48:08.000000000","message":"here","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ac5d631250b068257e1a325d50c817dbc25a1b57","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def __init__(self, plugin):"},{"line_number":66,"context_line":"        self.plugin \u003d plugin"},{"line_number":67,"context_line":"        self.pool_to_port_id \u003d {}"},{"line_number":68,"context_line":"        self.ncc_uri \u003d cfg.CONF.netscaler_driver.netscaler_ncc_uri"},{"line_number":69,"context_line":"        self.ncc_username \u003d cfg.CONF.netscaler_driver.netscaler_ncc_username"},{"line_number":70,"context_line":"        self.ncc_password \u003d cfg.CONF.netscaler_driver.netscaler_ncc_password"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FQ6c%3D","line":67,"updated":"2014-02-14 13:15:40.000000000","message":"seems not used","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ac5d631250b068257e1a325d50c817dbc25a1b57","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def __init__(self, plugin):"},{"line_number":66,"context_line":"        self.plugin \u003d plugin"},{"line_number":67,"context_line":"        self.pool_to_port_id \u003d {}"},{"line_number":68,"context_line":"        self.ncc_uri \u003d cfg.CONF.netscaler_driver.netscaler_ncc_uri"},{"line_number":69,"context_line":"        self.ncc_username \u003d cfg.CONF.netscaler_driver.netscaler_ncc_username"},{"line_number":70,"context_line":"        self.ncc_password \u003d cfg.CONF.netscaler_driver.netscaler_ncc_password"},{"line_number":71,"context_line":"        self.client \u003d ncc_client.NSClient(self.ncc_uri,"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FQ6I%3D","line":68,"updated":"2014-02-14 13:15:40.000000000","message":"since used only on #71 probably shouldn\u0027t be class member. Same for username and password","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def __init__(self, plugin):"},{"line_number":66,"context_line":"        self.plugin \u003d plugin"},{"line_number":67,"context_line":"        self.pool_to_port_id \u003d {}"},{"line_number":68,"context_line":"        self.ncc_uri \u003d cfg.CONF.netscaler_driver.netscaler_ncc_uri"},{"line_number":69,"context_line":"        self.ncc_username \u003d cfg.CONF.netscaler_driver.netscaler_ncc_username"},{"line_number":70,"context_line":"        self.ncc_password \u003d cfg.CONF.netscaler_driver.netscaler_ncc_password"},{"line_number":71,"context_line":"        self.client \u003d ncc_client.NSClient(self.ncc_uri,"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqkI%3D","line":68,"in_reply_to":"AAAAUX%2F%2FQ6I%3D","updated":"2014-02-19 22:48:08.000000000","message":"I guess these are handy to shorten them in the constructor","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                                          self.ncc_password)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def create_vip(self, context, vip):"},{"line_number":76,"context_line":"        \"\"\"Creates a vip on a NetScaler device.\"\"\""},{"line_number":77,"context_line":"        network_info \u003d self._get_vip_network_info(context, vip)"},{"line_number":78,"context_line":"        ncc_vip \u003d self._prepare_vip_for_creation(vip)"},{"line_number":79,"context_line":"        ncc_vip \u003d dict(ncc_vip.items() + network_info.items())"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqjk%3D","line":76,"updated":"2014-02-19 22:48:08.000000000","message":"See my PEP8 related comment on previous docstrings.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        ncc_vip \u003d self._prepare_vip_for_creation(vip)"},{"line_number":79,"context_line":"        ncc_vip \u003d dict(ncc_vip.items() + network_info.items())"},{"line_number":80,"context_line":"        msg \u003d _(\"NetScaler driver vip creation: %(vip_obj)s\")"},{"line_number":81,"context_line":"        LOG.debug(msg, {\"vip_obj\": repr(ncc_vip)})"},{"line_number":82,"context_line":"        try:"},{"line_number":83,"context_line":"            self.client.create_resource(context.tenant_id, VIPS_RESOURCE,"},{"line_number":84,"context_line":"                                        VIP_RESOURCE, ncc_vip)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqjU%3D","line":81,"updated":"2014-02-19 22:48:08.000000000","message":"same suggestion for debug messages.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        ncc_vip \u003d dict(ncc_vip.items() + network_info.items())"},{"line_number":80,"context_line":"        msg \u003d _(\"NetScaler driver vip creation: %(vip_obj)s\")"},{"line_number":81,"context_line":"        LOG.debug(msg, {\"vip_obj\": repr(ncc_vip)})"},{"line_number":82,"context_line":"        try:"},{"line_number":83,"context_line":"            self.client.create_resource(context.tenant_id, VIPS_RESOURCE,"},{"line_number":84,"context_line":"                                        VIP_RESOURCE, ncc_vip)"},{"line_number":85,"context_line":"        except ncc_client.NCCException:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqfA%3D","line":82,"updated":"2014-02-19 22:48:08.000000000","message":"since you got to issue an update either way I\u0027d suggest you to do the following:\n\nstatus \u003d constants.ACTIVE\ntry:\n  ...\nexcept ...:\n  status \u003d constants.ERROR\n\nself.plugin.update_status(..., status)\n\nIt\u0027s a lot more compact and easier to read.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        resource_path \u003d \"%s/%s\" % (VIPS_RESOURCE, vip[\"id\"])"},{"line_number":97,"context_line":"        msg \u003d _(\"NetScaler driver vip %(vip_id)s update: %(vip_obj)s\")"},{"line_number":98,"context_line":"        LOG.debug(msg, {\"vip_id\": vip[\"id\"], \"vip_obj\": repr(vip)})"},{"line_number":99,"context_line":"        try:"},{"line_number":100,"context_line":"            self.client.update_resource(context.tenant_id, resource_path,"},{"line_number":101,"context_line":"                                        VIP_RESOURCE, update_vip)"},{"line_number":102,"context_line":"        except ncc_client.NCCException:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqe0%3D","line":99,"updated":"2014-02-19 22:48:08.000000000","message":"same as above","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        ncc_pool \u003d dict(ncc_pool.items() + network_info.items())"},{"line_number":135,"context_line":"        msg \u003d _(\"NetScaler driver pool creation: %(pool_obj)s\")"},{"line_number":136,"context_line":"        LOG.debug(msg, {\"pool_obj\": repr(ncc_pool)})"},{"line_number":137,"context_line":"        try:"},{"line_number":138,"context_line":"            self.client.create_resource(context.tenant_id, POOLS_RESOURCE,"},{"line_number":139,"context_line":"                                        POOL_RESOURCE, ncc_pool)"},{"line_number":140,"context_line":"        except ncc_client.NCCException:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqew%3D","line":137,"updated":"2014-02-19 22:48:08.000000000","message":"same","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        resource_path \u003d \"%s/%s\" % (POOLS_RESOURCE, old_pool[\"id\"])"},{"line_number":153,"context_line":"        msg \u003d _(\"NetScaler driver pool %(pool_id)s update: %(pool_obj)s\")"},{"line_number":154,"context_line":"        LOG.debug(msg, {\"pool_id\": old_pool[\"id\"], \"pool_obj\": repr(ncc_pool)})"},{"line_number":155,"context_line":"        try:"},{"line_number":156,"context_line":"            self.client.update_resource(context.tenant_id, resource_path,"},{"line_number":157,"context_line":"                                        POOL_RESOURCE, ncc_pool)"},{"line_number":158,"context_line":"        except ncc_client.NCCException:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqes%3D","line":155,"updated":"2014-02-19 22:48:08.000000000","message":"same","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        msg \u003d _(\"NetScaler driver poolmember creation: %(member_obj)s\")"},{"line_number":187,"context_line":"        ncc_member \u003d self._prepare_member_for_creation(member)"},{"line_number":188,"context_line":"        LOG.info(msg, {\"member_obj\": repr(ncc_member)})"},{"line_number":189,"context_line":"        try:"},{"line_number":190,"context_line":"            self.client.create_resource(context.tenant_id,"},{"line_number":191,"context_line":"                                        POOLMEMBERS_RESOURCE,"},{"line_number":192,"context_line":"                                        POOLMEMBER_RESOURCE,"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqeY%3D","line":189,"updated":"2014-02-19 22:48:08.000000000","message":"here too","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":208,"context_line":"                \" %(member_obj)s\")"},{"line_number":209,"context_line":"        LOG.debug(msg, {\"member_id\": old_member[\"id\"],"},{"line_number":210,"context_line":"                        \"member_obj\": repr(ncc_member)})"},{"line_number":211,"context_line":"        try:"},{"line_number":212,"context_line":"            self.client.update_resource(context.tenant_id, resource_path,"},{"line_number":213,"context_line":"                                        POOLMEMBER_RESOURCE, ncc_member)"},{"line_number":214,"context_line":"        except ncc_client.NCCException:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqeQ%3D","line":211,"updated":"2014-02-19 22:48:08.000000000","message":"ditto","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":243,"context_line":"        msg \u003d _(\"NetScaler driver healthmonitor creation for pool %(pool_id)s\""},{"line_number":244,"context_line":"                \": %(monitor_obj)s\")"},{"line_number":245,"context_line":"        LOG.debug(msg, {\"pool_id\": pool_id, \"monitor_obj\": repr(ncc_hm)})"},{"line_number":246,"context_line":"        try:"},{"line_number":247,"context_line":"            self.client.create_resource(context.tenant_id, resource_path,"},{"line_number":248,"context_line":"                                        MONITOR_RESOURCE,"},{"line_number":249,"context_line":"                                        ncc_hm)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqeE%3D","line":246,"updated":"2014-02-19 22:48:08.000000000","message":"here","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":268,"context_line":"                \"%(monitor_obj)s\")"},{"line_number":269,"context_line":"        LOG.debug(msg, {\"monitor_id\": old_health_monitor[\"id\"],"},{"line_number":270,"context_line":"                        \"monitor_obj\": repr(ncc_hm)})"},{"line_number":271,"context_line":"        try:"},{"line_number":272,"context_line":"            self.client.update_resource(context.tenant_id, resource_path,"},{"line_number":273,"context_line":"                                        MONITOR_RESOURCE, ncc_hm)"},{"line_number":274,"context_line":"        except ncc_client.NCCException:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqeA%3D","line":271,"updated":"2014-02-19 22:48:08.000000000","message":"here","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":382,"context_line":"            \u0027type\u0027: health_monitor[\u0027type\u0027],"},{"line_number":383,"context_line":"        }"},{"line_number":384,"context_line":"        update_attrs \u003d self._prepare_healthmonitor_for_update(health_monitor)"},{"line_number":385,"context_line":"        return dict(creation_attrs.items() + update_attrs.items())"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    def _prepare_healthmonitor_for_update(self, health_monitor):"},{"line_number":388,"context_line":"        ncc_hm \u003d {"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2BqdY%3D","line":385,"updated":"2014-02-19 22:48:08.000000000","message":"instead of creating a third dict to you could do:\n\ncreation_attrs.update(update_attrs)","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4ec75d9735cc53b3d230044595471553cbfd1eec","unresolved":false,"context_lines":[{"line_number":406,"context_line":""},{"line_number":407,"context_line":"    def _get_pools_on_subnet(self, context, tenant_id, subnet_id):"},{"line_number":408,"context_line":"        filter_dict \u003d {\u0027subnet_id\u0027: [subnet_id], \u0027tenant_id\u0027: [tenant_id]}"},{"line_number":409,"context_line":"        pools \u003d self.plugin.get_pools(context, filters\u003dfilter_dict)"},{"line_number":410,"context_line":"        return pools"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"    def _get_snatport_for_subnet(self, context, tenant_id, subnet_id):"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUX%2F%2Bg9c%3D","line":409,"updated":"2014-02-20 19:12:15.000000000","message":"could eliminate temp variable","commit_id":"3a18ea220b134dd3b992acb4887a68679f139f8e"}],"neutron/tests/unit/services/loadbalancer/drivers/netscaler/__init__.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2013 New Dream Network, LLC (DreamHost)"},{"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":5,"id":"AAAATn%2F%2BtaI%3D","line":3,"updated":"2013-11-21 09:32:35.000000000","message":"Citrix?","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2013 New Dream Network, LLC (DreamHost)"},{"line_number":4,"context_line":"#"},{"line_number":5,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F%2FYX0%3D","line":2,"updated":"2014-01-14 12:23:20.000000000","message":"File can be left empty.","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"}],"neutron/tests/unit/services/loadbalancer/drivers/netscaler/test_ncc_client.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":34,"context_line":"HTTP_PUT \u003d \u0027PUT\u0027"},{"line_number":35,"context_line":"HTTP_DELETE \u003d \u0027DELETE\u0027"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"HTTP_STATUSCODE_SUCCESS \u003d 201"},{"line_number":38,"context_line":"HTTP_STATUSCODE_FAILURE \u003d 404"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"TESTURI_SCHEME \u003d \u0027https\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvMY%3D","line":37,"updated":"2013-11-20 21:58:41.000000000","message":"Can use webob.exe definitions for HTTP codes.","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"class TestNSClient(testlib_api.WebTestCase):"},{"line_number":53,"context_line":"    \"\"\"A Unit test for the NetScaler NCC client module. This test mocks"},{"line_number":54,"context_line":"       the http connection. \"\"\""},{"line_number":55,"context_line":"    def setUp(self):"},{"line_number":56,"context_line":"        self.log \u003d mock.patch.object(ncc_client, \u0027LOG\u0027).start()"},{"line_number":57,"context_line":"        super(TestNSClient, self).setUp()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvMQ%3D","line":54,"updated":"2013-11-20 21:58:41.000000000","message":"PEP257: blank line before and after docstring for class, summary on one line with period, additional lines after (separated by a space).","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.log \u003d mock.patch.object(ncc_client, \u0027LOG\u0027).start()"},{"line_number":57,"context_line":"        super(TestNSClient, self).setUp()"},{"line_number":58,"context_line":"        # mock the httplib.HTTPConnection class (REST client)"},{"line_number":59,"context_line":"        connectionclass \u003d \u0027httplib.HTTPConnection\u0027 \\"},{"line_number":60,"context_line":"                           if TESTURI_SCHEME \u003d\u003d \u0027http\u0027 \\"},{"line_number":61,"context_line":"                           else \u0027httplib.HTTPSConnection\u0027"},{"line_number":62,"context_line":"        self.connection_mock_cls \u003d mock.patch(connectionclass).start()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvLw%3D","line":59,"updated":"2013-11-20 21:58:41.000000000","message":"replace backslashes with parens or consider just doing:\nif TESTURI_SCHEME \u003d\u003d \u0027http\u0027:\n    connecitonclass \u003d \u0027httplib.HTTPConnection\u0027\nelse:\n    connectionclass \u003d \u0027httplib.HTTPSConnection\u0027","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        self.addCleanup(mock.patch.stopall)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def test_instantiate_nsclient_with_empty_uri(self):"},{"line_number":66,"context_line":"        #setup test"},{"line_number":67,"context_line":"        test_uri \u003d \u0027\u0027"},{"line_number":68,"context_line":"        test_username \u003d TEST_USERNAME"},{"line_number":69,"context_line":"        test_password \u003d TEST_PASSWORD"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvLY%3D","line":66,"updated":"2013-11-20 21:58:41.000000000","message":"Value add of some of the comments in file, like this one and L70, for example?\n\nFocus on comments that explain why things are done, and consider removing obvious ones.","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        test_username \u003d TEST_USERNAME"},{"line_number":69,"context_line":"        test_password \u003d TEST_PASSWORD"},{"line_number":70,"context_line":"        #call method under test and assert that it raises an exception"},{"line_number":71,"context_line":"        self.assertRaises(Exception, NSClient,"},{"line_number":72,"context_line":"                          test_uri, test_username,"},{"line_number":73,"context_line":"                          test_password)"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvKc%3D","line":71,"updated":"2013-11-20 21:58:41.000000000","message":"Could just use the defined values, and eliminate temp variables:\n\nself.assertRaises(Exception, NSClient, \u0027\u0027, TEST_USERNAME, TEST_PASSWORD)","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":104,"context_line":"    def test_create_resource_with_error(self):"},{"line_number":105,"context_line":"        #create a mock object to represent a valid http response"},{"line_number":106,"context_line":"        # with a failure status code."},{"line_number":107,"context_line":"        response_mock \u003d mock.MagicMock()"},{"line_number":108,"context_line":"        response_mock.status \u003d HTTP_STATUSCODE_FAILURE"},{"line_number":109,"context_line":"        response_mock.read.return_value \u003d \u0027\u0027"},{"line_number":110,"context_line":"        response_mock.getheaders.return_value \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvKA%3D","line":107,"updated":"2013-11-20 21:58:41.000000000","message":"Since there are blocks of code, just for setting up the test, and there is duplication in test cases, consider a helper function with an intention revealing name, like:\n\nresponse \u003d _generate_mock_response_with_status(code)\n\nCould reuse in several test cases.","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        connection_instance \u003d self.connection_mock_cls.return_value"},{"line_number":114,"context_line":"        connection_instance.getresponse.return_value \u003d response_mock"},{"line_number":115,"context_line":"        #set up the test"},{"line_number":116,"context_line":"        testclient \u003d self._get_nsclient()"},{"line_number":117,"context_line":"        resource_path \u003d netscaler_driver.VIPS_RESOURCE"},{"line_number":118,"context_line":"        resource_name \u003d netscaler_driver.VIP_RESOURCE"},{"line_number":119,"context_line":"        resource_body \u003d self._get_testvip_httpbody_for_create()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvJ0%3D","line":116,"updated":"2013-11-20 21:58:41.000000000","message":"Likewise, there is some other test setup code that is duplicated. Maybe you can use another helper function, or consider breaking out some tests into another class and use a setup() to prepare the whole test?","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2013 New Dream Network, LLC (DreamHost)"},{"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":5,"id":"AAAATn%2F%2BtZs%3D","line":3,"updated":"2013-11-21 09:32:35.000000000","message":"ditto","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":17,"context_line":"# @author: Youcef Laribi, Citrix"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import httplib"},{"line_number":20,"context_line":"import mock"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from neutron.common import exceptions"},{"line_number":23,"context_line":"from neutron.services.loadbalancer.drivers.netscaler import ("}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtZg%3D","line":20,"updated":"2013-11-21 09:32:35.000000000","message":"mock is third party, please use a separate import section","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"class TestNSClient(testlib_api.WebTestCase):"},{"line_number":53,"context_line":"    \"\"\"A Unit test for the NetScaler NCC client module. This test mocks"},{"line_number":54,"context_line":"       the http connection. \"\"\""},{"line_number":55,"context_line":"    def setUp(self):"},{"line_number":56,"context_line":"        self.log \u003d mock.patch.object(ncc_client, \u0027LOG\u0027).start()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Br5Y%3D","line":53,"updated":"2013-11-21 15:16:03.000000000","message":"PEP257, blank line before and after class doc string. Put summary on one line with a period, more on additional lines separated by a blank line from summary. (you can Google for pep257)","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.log \u003d mock.patch.object(ncc_client, \u0027LOG\u0027).start()"},{"line_number":57,"context_line":"        super(TestNSClient, self).setUp()"},{"line_number":58,"context_line":"        # mock the httplib.HTTPConnection class (REST client)"},{"line_number":59,"context_line":"        connectionclass \u003d \u0027httplib.HTTPConnection\u0027 \\"},{"line_number":60,"context_line":"                           if TESTURI_SCHEME \u003d\u003d \u0027http\u0027 \\"},{"line_number":61,"context_line":"                           else \u0027httplib.HTTPSConnection\u0027"},{"line_number":62,"context_line":"        self.connection_mock_cls \u003d mock.patch(connectionclass).start()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtZA%3D","line":59,"updated":"2013-11-21 09:32:35.000000000","message":"please don\u0027t use \\ for new lines, use parentheses","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        test_username \u003d TEST_USERNAME"},{"line_number":69,"context_line":"        test_password \u003d TEST_PASSWORD"},{"line_number":70,"context_line":"        #call method under test and assert that it raises an exception"},{"line_number":71,"context_line":"        self.assertRaises(Exception, NSClient,"},{"line_number":72,"context_line":"                          test_uri, test_username,"},{"line_number":73,"context_line":"                          test_password)"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtYs%3D","line":71,"updated":"2013-11-21 09:32:35.000000000","message":"consider catching a particular type of exception","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        test_password \u003d TEST_PASSWORD"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        #call method under test: A new instance of NSClient"},{"line_number":82,"context_line":"        testclient \u003d NSClient(test_uri, test_username, test_password)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # assert that the URI has been parsed correctly"},{"line_number":85,"context_line":"        assert(testclient.host \u003d\u003d TESTURI_HOSTNAME)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtYY%3D","line":82,"updated":"2013-11-21 09:32:35.000000000","message":"why not using self_get_nsclient()","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        testclient \u003d NSClient(test_uri, test_username, test_password)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # assert that the URI has been parsed correctly"},{"line_number":85,"context_line":"        assert(testclient.host \u003d\u003d TESTURI_HOSTNAME)"},{"line_number":86,"context_line":"        assert(testclient.port \u003d\u003d str(TESTURI_PORT))"},{"line_number":87,"context_line":"        assert(testclient.protocol \u003d\u003d TESTURI_SCHEME)"},{"line_number":88,"context_line":"        assert(testclient.service_path \u003d\u003d TESTURI_PATH)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtYk%3D","line":85,"updated":"2013-11-21 09:32:35.000000000","message":"please use self.assertEqual()","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        # mock a connection object that fails to establish a connection"},{"line_number":92,"context_line":"        self.connection_mock_cls.side_effect \u003d httplib.HTTPException()"},{"line_number":93,"context_line":"        #setup test"},{"line_number":94,"context_line":"        testclient \u003d self._get_nsclient()"},{"line_number":95,"context_line":"        resource_path \u003d netscaler_driver.VIPS_RESOURCE"},{"line_number":96,"context_line":"        resource_name \u003d netscaler_driver.VIP_RESOURCE"},{"line_number":97,"context_line":"        resource_body \u003d self._get_testvip_httpbody_for_create()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtYU%3D","line":94,"updated":"2013-11-21 09:32:35.000000000","message":"consider setting up self.testclient in setUp() as it is used in almost all tests","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                          TEST_TENANT_ID, resource_path,"},{"line_number":102,"context_line":"                          resource_name, resource_body)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def test_create_resource_with_error(self):"},{"line_number":105,"context_line":"        #create a mock object to represent a valid http response"},{"line_number":106,"context_line":"        # with a failure status code."},{"line_number":107,"context_line":"        response_mock \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Br3Q%3D","line":104,"updated":"2013-11-21 15:16:03.000000000","message":"Since some of these test cases below use similar logic for setup of the test case, you can either A) create a helper function and put the logic in there with a descriptive function name, or B) pull these test cases into another class and use a setup function to do the test case setup steps.\n\ne.g.\n\ndef _create_response_mock(status_to_report):\n     response_mock \u003d mock.MagicMock()\n     response_mock.status \u003d status_to_report\n     response_mock.read.return_value \u003d \u0027\u0027\n     response_mock.getheaders.return_value \u003d []\n     # mock the getresponse() method of httplib.HTTPConnection class\n     # to return the object above.\n     connection_instance \u003d self.connection_mock_cls.return_value\n     connection_instance.getresponse.return_value \u003d response_mock\n     testclient \u003d self._get_nsclient()\n     resource_path \u003d netscaler_driver.VIPS_RESOURCE\n     resource_name \u003d netscaler_driver.VIP_RESOURCE\n     resource_body \u003d self._get_testvip_httpbody_for_create()\n     return testclient, resource_name, resource_path, resource_body","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def test_update_resource_with_error(self):"},{"line_number":158,"context_line":"        #create a mock object to represent a valid http response"},{"line_number":159,"context_line":"        response_mock \u003d mock.MagicMock()"},{"line_number":160,"context_line":"        response_mock.status \u003d HTTP_STATUSCODE_FAILURE"},{"line_number":161,"context_line":"        response_mock.read.return_value \u003d \u0027\u0027"},{"line_number":162,"context_line":"        response_mock.getheaders.return_value \u003d []"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtXw%3D","line":159,"updated":"2013-11-21 09:32:35.000000000","message":"below 4 lines look like a common pattern across all tests - please add a helper method accepting status.","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":17,"context_line":"# @author: Youcef Laribi, Citrix"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import httplib"},{"line_number":20,"context_line":"import mock"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from neutron.services.loadbalancer.drivers.netscaler import ("},{"line_number":23,"context_line":"    ncc_client, netscaler_driver"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BaW0%3D","line":20,"updated":"2013-11-26 11:50:27.000000000","message":"please address the comment left on the previos patch set","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from neutron.services.loadbalancer.drivers.netscaler import ("},{"line_number":23,"context_line":"    ncc_client, netscaler_driver"},{"line_number":24,"context_line":"    )"},{"line_number":25,"context_line":"from neutron.services.loadbalancer.drivers.netscaler.ncc_client import ("},{"line_number":26,"context_line":"       NCCException)"},{"line_number":27,"context_line":"from neutron.services.loadbalancer.drivers.netscaler.ncc_client import NSClient"},{"line_number":28,"context_line":"from neutron.tests.unit import testlib_api"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BaXU%3D","line":25,"updated":"2013-11-26 11:50:27.000000000","message":"please use module level imports","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        self.log \u003d mock.patch.object(ncc_client, \u0027LOG\u0027).start()"},{"line_number":52,"context_line":"        super(TestNSClient, self).setUp()"},{"line_number":53,"context_line":"        # mock the httplib.HTTPConnection class (REST client)"},{"line_number":54,"context_line":"        connectionclass \u003d \u0027httplib.HTTPConnection\u0027 \\"},{"line_number":55,"context_line":"                           if TESTURI_SCHEME \u003d\u003d \u0027http\u0027 \\"},{"line_number":56,"context_line":"                           else \u0027httplib.HTTPSConnection\u0027"},{"line_number":57,"context_line":"        self.connection_mock_cls \u003d mock.patch(connectionclass).start()"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BaWc%3D","line":54,"updated":"2013-11-26 11:50:27.000000000","message":"please address the comment left on the previos patch set","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"98262995696cb8396d2e4f94421105ec65e7aed9","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        test_username \u003d TEST_USERNAME"},{"line_number":64,"context_line":"        test_password \u003d TEST_PASSWORD"},{"line_number":65,"context_line":"        #call method under test and assert that it raises an exception"},{"line_number":66,"context_line":"        self.assertRaises(Exception, NSClient,"},{"line_number":67,"context_line":"                          test_uri, test_username,"},{"line_number":68,"context_line":"                          test_password)"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BaWQ%3D","line":66,"updated":"2013-11-26 11:50:27.000000000","message":"please respond/address the comment left on the previos patch set. Please do it for all comments in this and next modules","commit_id":"361acfd44855123d86e4c57881135c4cd74a0fb0"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2013 Citrix Systems"},{"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":12,"id":"AAAAUH%2F%2FYXw%3D","line":3,"updated":"2014-01-14 12:23:20.000000000","message":"Copyright date of new file.","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        self.addCleanup(mock.patch.stopall)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def test_instantiate_nsclient_with_empty_uri(self):"},{"line_number":60,"context_line":"        #call method under test and assert that it raises an exception"},{"line_number":61,"context_line":"        self.assertRaises(ncc_client.NCCException, ncc_client.NSClient,"},{"line_number":62,"context_line":"                          \u0027\u0027, TEST_USERNAME, TEST_PASSWORD)"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F%2FYXc%3D","line":60,"updated":"2014-01-14 12:23:20.000000000","message":"Should you make these comments docstring summary lines?","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"ab3f74d2659a98dbb027640b5571f1f8a8b64468","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def test_create_resource_with_error(self):"},{"line_number":85,"context_line":"        \"\"\""},{"line_number":86,"context_line":"        Asserts that a create call that returns an error status code"},{"line_number":87,"context_line":"           will raise an exception."},{"line_number":88,"context_line":"        \"\"\""},{"line_number":89,"context_line":"        # create a mock object to represent a valid http response"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAUH%2F%2FSzo%3D","line":86,"updated":"2014-01-15 11:48:15.000000000","message":"PEP257: First line of doc string should be summary, with period at end of line. Additional lines can follow, with a blank line separating. Consider re-wording to fit on one line or break into multiple lines, with summary on first line.\n\nE.g.\n\"\"\"Assert that calls returning failure will raise exception.\"\"\"\n\nSame for docstrings on L126+ and L172+","commit_id":"d688fdb0a516ffd7e0f455e0fdd9451e9428a07a"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    def test_instantiate_nsclient_with_valid_uri(self):"},{"line_number":64,"context_line":"        \"\"\"Asserts that the URI has been parsed correctly.\"\"\""},{"line_number":65,"context_line":"        self.assertEqual(self.testclient.host, TESTURI_HOSTNAME)"},{"line_number":66,"context_line":"        self.assertEqual(self.testclient.port, str(TESTURI_PORT))"},{"line_number":67,"context_line":"        self.assertEqual(self.testclient.protocol, TESTURI_SCHEME)"},{"line_number":68,"context_line":"        self.assertEqual(self.testclient.service_path, TESTURI_PATH)"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97eo%3D","line":66,"updated":"2014-01-31 23:45:39.000000000","message":"Seem really awkward that this not an int.","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ac5d631250b068257e1a325d50c817dbc25a1b57","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        body[\u0027admin_state_up\u0027] \u003d False"},{"line_number":210,"context_line":"        return body"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def _setup_response_mock(self, resp_status):"},{"line_number":213,"context_line":"        response_mock \u003d mock.MagicMock()"},{"line_number":214,"context_line":"        response_mock.status \u003d resp_status"},{"line_number":215,"context_line":"        response_mock.read.return_value \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FQvc%3D","line":212,"updated":"2014-02-14 13:15:40.000000000","message":"is it used?","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36293d57c6931deb198e313592c98fe0423df4a","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        body[\u0027admin_state_up\u0027] \u003d False"},{"line_number":210,"context_line":"        return body"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def _setup_response_mock(self, resp_status):"},{"line_number":213,"context_line":"        response_mock \u003d mock.MagicMock()"},{"line_number":214,"context_line":"        response_mock.status \u003d resp_status"},{"line_number":215,"context_line":"        response_mock.read.return_value \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2Bqcg%3D","line":212,"in_reply_to":"AAAAUX%2F%2FQvc%3D","updated":"2014-02-19 22:48:08.000000000","message":"Looks like it is not. Please remove.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4ec75d9735cc53b3d230044595471553cbfd1eec","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2014 Citrix Systems"},{"line_number":4,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUX%2F%2Bg8Y%3D","line":1,"updated":"2014-02-20 19:12:15.000000000","message":"Remove VIM line from new files.","commit_id":"3a18ea220b134dd3b992acb4887a68679f139f8e"}],"neutron/tests/unit/services/loadbalancer/drivers/netscaler/test_netscaler_driver.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"class FakeDBObject(dict):"},{"line_number":60,"context_line":"    \"\"\" Class that allows the object\u0027s attributes to be accessed either as"},{"line_number":61,"context_line":"        a dict or an object. \"\"\""},{"line_number":62,"context_line":"    def __getattr__(self, name):"},{"line_number":63,"context_line":"        return self[name]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvJs%3D","line":60,"updated":"2013-11-20 21:58:41.000000000","message":"Similar PEP257 comments in this file.","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"5d4f2c6453b1a8772ed86fce7d02d865d27a20cd","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        self.create_resource_mock.side_effect \u003d mock_create_resource_func"},{"line_number":95,"context_line":"        self.update_resource_mock \u003d self.client_mock_instance.update_resource"},{"line_number":96,"context_line":"        self.update_resource_mock.side_effect \u003d mock_update_resource_func"},{"line_number":97,"context_line":"        self.retrieve_resource_mock \u003d \\"},{"line_number":98,"context_line":"                               self.client_mock_instance.retrieve_resource"},{"line_number":99,"context_line":"        self.retrieve_resource_mock.side_effect \u003d mock_retrieve_resource_func"},{"line_number":100,"context_line":"        self.remove_resource_mock \u003d self.client_mock_instance.remove_resource"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BvJg%3D","line":97,"updated":"2013-11-20 21:58:41.000000000","message":"Use parens, instead of backslash. Here and elsewhere in file.","commit_id":"1ad33ef07775dd897ff71790670b39a98c20b877"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2013 New Dream Network, LLC (DreamHost)"},{"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":5,"id":"AAAATn%2F%2BtXs%3D","line":3,"updated":"2013-11-21 09:32:35.000000000","message":"ditto","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"2ad5bf207ec440e5688505f3a0f607fc22e242e4","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"class FakeDBObject(dict):"},{"line_number":60,"context_line":"    \"\"\" Allows its objects attributes to be accessed as a dict. \"\"\""},{"line_number":61,"context_line":"    def __getattr__(self, name):"},{"line_number":62,"context_line":"        return self[name]"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Br3A%3D","line":60,"updated":"2013-11-21 15:16:03.000000000","message":"PEP257","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":78,"context_line":"class TestNetScalerPluginDriver(TestLoadBalancerPluginBase):"},{"line_number":79,"context_line":"    \"\"\"Unit tests for the NetScaler LBaaS driver module.\"\"\""},{"line_number":80,"context_line":"    def setUp(self):"},{"line_number":81,"context_line":"        self.log \u003d mock.patch.object(netscaler_driver, \u0027LOG\u0027).start()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        # mock the NSClient class (REST client)"},{"line_number":84,"context_line":"        client_mock_cls \u003d mock.patch(NCC_CLIENT_CLASS).start()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtRw%3D","line":81,"updated":"2013-11-21 09:32:35.000000000","message":"seems self.log is not used","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":322,"context_line":"                                                   constants.ACTIVE))"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"    def test_delete_pool(self):"},{"line_number":325,"context_line":"        with self.subnet() as subnet:"},{"line_number":326,"context_line":"            with mock.patch.object(self.driver.plugin._core_plugin,"},{"line_number":327,"context_line":"                                   \u0027get_subnet\u0027) as mock_get_subnet:"},{"line_number":328,"context_line":"                mock_get_subnet.return_value \u003d subnet[\u0027subnet\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtQ4%3D","line":325,"updated":"2013-11-21 09:32:35.000000000","message":"consider using contextlib.nested() to group multiple with statements where possible and improve readability","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"61eb275efbe4ce7f6a89e5eb45b0c97529159c95","unresolved":false,"context_lines":[{"line_number":363,"context_line":"                    testmember \u003d self._build_testmember_contents(pool[\u0027pool\u0027])"},{"line_number":364,"context_line":"                    expectedmember \u003d self._build_expectedmember_contents("},{"line_number":365,"context_line":"                                                                  testmember"},{"line_number":366,"context_line":"                                                                        )"},{"line_number":367,"context_line":"                    # mock the driver\u0027s set_member_status() that updates DB"},{"line_number":368,"context_line":"                    # This is easier to mock than trying to mock sqlalchemy"},{"line_number":369,"context_line":"                    # Query/filter_by()/etc. objects."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BtQs%3D","line":366,"updated":"2013-11-21 09:32:35.000000000","message":"nit: can place at the end of #365","commit_id":"8d34103929d58b0a1f625f19b66a9713848902fa"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"3c6a44394c5c4ca2283a6d73453c0bc7df0ec64e","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        self.addCleanup(mock.patch.stopall)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def test_create_vip(self):"},{"line_number":116,"context_line":"        with contextlib.nested(self.subnet(),"},{"line_number":117,"context_line":"                         mock.patch.object(self.driver.plugin._core_plugin,"},{"line_number":118,"context_line":"                                   \u0027get_subnet\u0027)) as (subnet, mock_get_subnet):"},{"line_number":119,"context_line":"            mock_get_subnet.return_value \u003d subnet[\u0027subnet\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2BG5k%3D","line":116,"updated":"2013-12-02 14:54:03.000000000","message":"There is a lot of duplication in the test cases. Consider refactoring the tests...","commit_id":"2ea95a4b563252810135864ee5e6d779e880c95b"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"3c6a44394c5c4ca2283a6d73453c0bc7df0ec64e","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                                                           subnet[\u0027subnet\u0027])"},{"line_number":125,"context_line":"                # mock the LBaaS plugin update_status()."},{"line_number":126,"context_line":"                self._mock_update_status()"},{"line_number":127,"context_line":"                # reset the create_resource() mock"},{"line_number":128,"context_line":"                self.create_resource_mock.reset_mock()"},{"line_number":129,"context_line":"                # execute the method under test"},{"line_number":130,"context_line":"                self.driver.create_vip(self.context, testvip)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2BG68%3D","line":127,"updated":"2013-12-02 14:54:03.000000000","message":"Nit: Many of the comments in this file, like the above line, don\u0027t really add value. Consider removing...","commit_id":"2ea95a4b563252810135864ee5e6d779e880c95b"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2013 Citrix Systems"},{"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":12,"id":"AAAAUH%2F%2FYXE%3D","line":3,"updated":"2014-01-14 12:23:20.000000000","message":"Date.","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d62291c04c859f4e7ff667e34cd3ec512c9945b7","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                expectedvip \u003d self._build_expectedvip_contents("},{"line_number":120,"context_line":"                    testvip,"},{"line_number":121,"context_line":"                    subnet[\u0027subnet\u0027])"},{"line_number":122,"context_line":"                # mock the LBaaS plugin update_status()."},{"line_number":123,"context_line":"                self._mock_update_status()"},{"line_number":124,"context_line":"                # reset the create_resource() mock"},{"line_number":125,"context_line":"                self.create_resource_mock.reset_mock()"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F%2FYWQ%3D","line":122,"updated":"2014-01-14 12:23:20.000000000","message":"Just curious as to whether some of this logic, which appears to be setting up for the test and is repeated in several test cases, could be put into setUp?","commit_id":"f18da9d62d7b5273e9baa4b8e7041481c91dcf80"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":624,"context_line":"                        monitor_resource_path)"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":"    def _build_testvip_contents(self, subnet, pool):"},{"line_number":627,"context_line":"        vip_obj \u003d FakeDBObject()"},{"line_number":628,"context_line":"        vip_obj.id \u003d TESTVIP_ID"},{"line_number":629,"context_line":"        vip_obj.name \u003d \u0027testvip\u0027"},{"line_number":630,"context_line":"        vip_obj.description \u003d \u0027a test vip\u0027"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97ec%3D","line":627,"updated":"2014-01-31 23:45:39.000000000","message":"since FakeDBObject is subclass of dict why not pass these as kwargs to the init.\n\nvip_obj \u003d FakeDBObject(\n    id\u003dTESTVIP_ID,\n    name\u003d\u0027testvip\u0027,\n    ...\n)","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":642,"context_line":"        return vip_obj"},{"line_number":643,"context_line":""},{"line_number":644,"context_line":"    def _build_expectedvip_contents(self, testvip, subnet):"},{"line_number":645,"context_line":"        expectedvip \u003d FakeDBObject()"},{"line_number":646,"context_line":"        expectedvip.id \u003d testvip.id"},{"line_number":647,"context_line":"        expectedvip.name \u003d testvip.name"},{"line_number":648,"context_line":"        expectedvip.description \u003d testvip.description"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97eY%3D","line":645,"updated":"2014-01-31 23:45:39.000000000","message":"same comment about wags","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":666,"context_line":"        return testvip"},{"line_number":667,"context_line":""},{"line_number":668,"context_line":"    def _build_updated_expectedvip_contents(self, testvip, subnet, pool):"},{"line_number":669,"context_line":"        expectedvip \u003d FakeDBObject()"},{"line_number":670,"context_line":"        expectedvip.name \u003d testvip[\u0027name\u0027]"},{"line_number":671,"context_line":"        expectedvip.description \u003d testvip[\u0027description\u0027]"},{"line_number":672,"context_line":"        expectedvip.connection_limit \u003d testvip[\u0027connection_limit\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97eM%3D","line":669,"updated":"2014-01-31 23:45:39.000000000","message":"same comment as above","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":675,"context_line":"        return expectedvip"},{"line_number":676,"context_line":""},{"line_number":677,"context_line":"    def _build_testpool_contents(self, subnet):"},{"line_number":678,"context_line":"        pool_obj \u003d FakeDBObject()"},{"line_number":679,"context_line":"        pool_obj.id \u003d TESTPOOL_ID"},{"line_number":680,"context_line":"        pool_obj.name \u003d \u0027testpool\u0027"},{"line_number":681,"context_line":"        pool_obj.description \u003d \u0027a test pool\u0027"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97eI%3D","line":678,"updated":"2014-01-31 23:45:39.000000000","message":"Same as above","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":694,"context_line":"        return pool_obj"},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"    def _build_expectedpool_contents(self, testpool, subnet):"},{"line_number":697,"context_line":"        expectedpool \u003d FakeDBObject()"},{"line_number":698,"context_line":"        expectedpool.id \u003d testpool.id"},{"line_number":699,"context_line":"        expectedpool.name \u003d testpool.name"},{"line_number":700,"context_line":"        expectedpool.description \u003d testpool.description"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97eE%3D","line":697,"updated":"2014-01-31 23:45:39.000000000","message":"same as above","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":710,"context_line":"        return expectedpool"},{"line_number":711,"context_line":""},{"line_number":712,"context_line":"    def _build_updated_testpool_contents(self, testpool, subnet):"},{"line_number":713,"context_line":"        updated_pool \u003d dict(testpool.items())"},{"line_number":714,"context_line":"        updated_pool[\u0027name\u0027] \u003d \u0027udpated testpool\u0027"},{"line_number":715,"context_line":"        updated_pool[\u0027description\u0027] \u003d \u0027An updated version of test pool\u0027"},{"line_number":716,"context_line":"        updated_pool[\u0027lb_method\u0027] \u003d \u0027LEAST_CONNECTIONS\u0027"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97d4%3D","line":713,"updated":"2014-01-31 23:45:39.000000000","message":"same as above","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":724,"context_line":"        return updated_pool"},{"line_number":725,"context_line":""},{"line_number":726,"context_line":"    def _build_updated_expectedpool_contents(self, testpool, subnet):"},{"line_number":727,"context_line":"        expectedpool \u003d FakeDBObject()"},{"line_number":728,"context_line":"        expectedpool.name \u003d testpool[\u0027name\u0027]"},{"line_number":729,"context_line":"        expectedpool.description \u003d testpool[\u0027description\u0027]"},{"line_number":730,"context_line":"        expectedpool.lb_method \u003d testpool[\u0027lb_method\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97d0%3D","line":727,"updated":"2014-01-31 23:45:39.000000000","message":"same as above","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":732,"context_line":"        return expectedpool"},{"line_number":733,"context_line":""},{"line_number":734,"context_line":"    def _build_testmember_contents(self, pool):"},{"line_number":735,"context_line":"        member_obj \u003d FakeDBObject()"},{"line_number":736,"context_line":"        member_obj.id \u003d TESTMEMBER_ID"},{"line_number":737,"context_line":"        member_obj.tenant_id \u003d self._tenant_id"},{"line_number":738,"context_line":"        member_obj.pool_id \u003d pool[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97dw%3D","line":735,"updated":"2014-01-31 23:45:39.000000000","message":"same as above","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":745,"context_line":"        return member_obj"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"    def _build_expectedmember_contents(self, testmember):"},{"line_number":748,"context_line":"        expectedmember \u003d FakeDBObject()"},{"line_number":749,"context_line":"        expectedmember.id \u003d testmember.id"},{"line_number":750,"context_line":"        expectedmember.tenant_id \u003d testmember.tenant_id"},{"line_number":751,"context_line":"        expectedmember.pool_id \u003d testmember.pool_id"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97ds%3D","line":748,"updated":"2014-01-31 23:45:39.000000000","message":"same as above","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":757,"context_line":""},{"line_number":758,"context_line":"    def _build_updated_testmember_contents(self, testmember):"},{"line_number":759,"context_line":"        updated_member \u003d dict(testmember.items())"},{"line_number":760,"context_line":"        updated_member[\u0027weight\u0027] \u003d 3"},{"line_number":761,"context_line":"        updated_member[\u0027admin_state_up\u0027] \u003d True"},{"line_number":762,"context_line":"        updated_member[\u0027status\u0027] \u003d \u0027PENDING_UPDATE\u0027"},{"line_number":763,"context_line":"        updated_member[\u0027status_description\u0027] \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97c4%3D","line":760,"updated":"2014-01-31 23:45:39.000000000","message":"this can be simplified.\n\nupdated_member.update(\n    weight\u003d3,\n    admin_state_up\u003dTrue,\n    status\u003d\u0027PENDING_CREATE\u0027,\n    status_description\u003d\u0027\u0027\n)","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":771,"context_line":"        return expectedmember"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"    def _build_testhealthmonitor_contents(self, pool):"},{"line_number":774,"context_line":"        monitor_obj \u003d FakeDBObject()"},{"line_number":775,"context_line":"        monitor_obj.id \u003d TESTMONITOR_ID"},{"line_number":776,"context_line":"        monitor_obj.tenant_id \u003d self._tenant_id"},{"line_number":777,"context_line":"        monitor_obj.pools \u003d []"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97do%3D","line":774,"updated":"2014-01-31 23:45:39.000000000","message":"same comment as above","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":775,"context_line":"        monitor_obj.id \u003d TESTMONITOR_ID"},{"line_number":776,"context_line":"        monitor_obj.tenant_id \u003d self._tenant_id"},{"line_number":777,"context_line":"        monitor_obj.pools \u003d []"},{"line_number":778,"context_line":"        pool_obj \u003d {}"},{"line_number":779,"context_line":"        pool_obj[\"status\"] \u003d \"PENDING_CREATE\""},{"line_number":780,"context_line":"        pool_obj[\"status_description\"] \u003d None"},{"line_number":781,"context_line":"        pool_obj[\"pool_id\"] \u003d pool[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97dk%3D","line":778,"updated":"2014-01-31 23:45:39.000000000","message":"just create this dict inline\n\npool_obj \u003d {\n   \u0027status\u0027: \u0027PENDING_CREATE\u0027,\n   ...\n}","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":788,"context_line":"        return monitor_obj"},{"line_number":789,"context_line":""},{"line_number":790,"context_line":"    def _build_expectedhealthmonitor_contents(self, testhealthmonitor):"},{"line_number":791,"context_line":"        expectedmonitor \u003d FakeDBObject()"},{"line_number":792,"context_line":"        expectedmonitor.id \u003d testhealthmonitor.id"},{"line_number":793,"context_line":"        expectedmonitor.tenant_id \u003d testhealthmonitor.tenant_id"},{"line_number":794,"context_line":"        expectedmonitor.type \u003d testhealthmonitor.type"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97dg%3D","line":791,"updated":"2014-01-31 23:45:39.000000000","message":"same as above","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    def _build_updated_testhealthmonitor_contents(self, testmonitor):"},{"line_number":802,"context_line":"        updated_monitor \u003d dict(testmonitor.items())"},{"line_number":803,"context_line":"        updated_monitor[\u0027delay\u0027] \u003d 30"},{"line_number":804,"context_line":"        updated_monitor[\u0027timeout\u0027] \u003d 3"},{"line_number":805,"context_line":"        updated_monitor[\u0027max_retries\u0027] \u003d 5"},{"line_number":806,"context_line":"        updated_monitor[\u0027admin_state_up\u0027] \u003d True"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97dM%3D","line":803,"updated":"2014-01-31 23:45:39.000000000","message":"This can be simplified.\n\nupdated_monitor.update(\n   delay\u003d30,\n   timeout\u003d3,\n   max_retries\u003d5,\n   admin_state_up\u003dTrue\n)","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e071e1c917db67f7f375662dc3e57ddf8981b516","unresolved":false,"context_lines":[{"line_number":807,"context_line":"        return updated_monitor"},{"line_number":808,"context_line":""},{"line_number":809,"context_line":"    def _build_updated_expectedhealthmonitor_contents(self, testmonitor):"},{"line_number":810,"context_line":"        expectedmonitor \u003d FakeDBObject()"},{"line_number":811,"context_line":"        expectedmonitor.delay \u003d testmonitor[\u0027delay\u0027]"},{"line_number":812,"context_line":"        expectedmonitor.timeout \u003d testmonitor[\u0027timeout\u0027]"},{"line_number":813,"context_line":"        expectedmonitor.max_retries \u003d testmonitor[\u0027max_retries\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F97dI%3D","line":810,"updated":"2014-01-31 23:45:39.000000000","message":"same comment on using init.","commit_id":"d9cb85396cdff60241571eb00ec96dfb10fddbbd"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"8f29ad4c5a2ffd02560cc8d19dcdf320ca25bd98","unresolved":false,"context_lines":[{"line_number":613,"context_line":"                        monitor_resource_path)"},{"line_number":614,"context_line":""},{"line_number":615,"context_line":"    def _build_testvip_contents(self, subnet, pool):"},{"line_number":616,"context_line":"        vip_obj \u003d dict(id\u003dTESTVIP_ID,"},{"line_number":617,"context_line":"                       name\u003d\u0027testvip\u0027,"},{"line_number":618,"context_line":"                       description\u003d\u0027a test vip\u0027,"},{"line_number":619,"context_line":"                       tenant_id\u003dself._tenant_id,"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAUH%2F9t8M%3D","line":616,"updated":"2014-02-04 18:06:45.000000000","message":"NIT: The dicts could be created with...\n\nvip_obj \u003d {\u0027id\u0027: TESTVIP_ID,\n           \u0027name\u0027: \u0027testvip\u0027,\n           ...}","commit_id":"36a297685413088d7c2655e6a7d1d3f7ee231028"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ac5d631250b068257e1a325d50c817dbc25a1b57","unresolved":false,"context_lines":[{"line_number":16,"context_line":"#"},{"line_number":17,"context_line":"# @author: Youcef Laribi, Citrix"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import contextlib"},{"line_number":20,"context_line":"import mock"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from neutron.common import exceptions"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FQvE%3D","line":19,"updated":"2014-02-14 13:15:40.000000000","message":"contextlib is stdlib so please put a blank line after it","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ac5d631250b068257e1a325d50c817dbc25a1b57","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                # execute the method under test"},{"line_number":116,"context_line":"                self.driver.create_vip(self.context, testvip)"},{"line_number":117,"context_line":"                # unmock the plugin\u0027s update_status() call"},{"line_number":118,"context_line":"                self._unmock_update_status()"},{"line_number":119,"context_line":"                # First, assert that create_resource was called once"},{"line_number":120,"context_line":"                # with expected params."},{"line_number":121,"context_line":"                self.create_resource_mock.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FQsg%3D","line":118,"updated":"2014-02-14 13:15:40.000000000","message":"why need to unmock here (while having cleanup #97)? Same for other tests.","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4da72d153a9cc5b2aed231701f293e97375481a6","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        return vip_obj"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"    def _build_expectedvip_contents(self, testvip, subnet):"},{"line_number":633,"context_line":"        expectedvip \u003d dict(id\u003dtestvip[\u0027id\u0027],"},{"line_number":634,"context_line":"                           name\u003dtestvip[\u0027name\u0027],"},{"line_number":635,"context_line":"                           description\u003dtestvip[\u0027description\u0027],"},{"line_number":636,"context_line":"                           tenant_id\u003dtestvip[\u0027tenant_id\u0027],"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FWxk%3D","line":633,"updated":"2014-02-13 19:13:22.000000000","message":"so what\u0027s the difference between expectedvip and testvip?\ncan we just write:\n return testvip.copy()\n?","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4da72d153a9cc5b2aed231701f293e97375481a6","unresolved":false,"context_lines":[{"line_number":679,"context_line":"        return pool_obj"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"    def _build_expectedpool_contents(self, testpool, subnet):"},{"line_number":682,"context_line":"        expectedpool \u003d dict(id\u003dtestpool[\u0027id\u0027],"},{"line_number":683,"context_line":"                            name\u003dtestpool[\u0027name\u0027],"},{"line_number":684,"context_line":"                            description\u003dtestpool[\u0027description\u0027],"},{"line_number":685,"context_line":"                            tenant_id\u003dtestpool[\u0027tenant_id\u0027],"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FWw4%3D","line":682,"updated":"2014-02-13 19:13:22.000000000","message":"i\u0027d shorten it like that:\n expectedpool \u003d testpool.copy()\n expectedpool[\u0027sbat_ip\u0027] \u003d TESTPOOL_SNATIP_ADDRESS\n ...\n return expectedpool","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4da72d153a9cc5b2aed231701f293e97375481a6","unresolved":false,"context_lines":[{"line_number":694,"context_line":"        return expectedpool"},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"    def _build_updated_testpool_contents(self, testpool, subnet):"},{"line_number":697,"context_line":"        updated_pool \u003d dict(testpool.items())"},{"line_number":698,"context_line":"        updated_pool[\u0027name\u0027] \u003d \u0027udpated testpool\u0027"},{"line_number":699,"context_line":"        updated_pool[\u0027description\u0027] \u003d \u0027An updated version of test pool\u0027"},{"line_number":700,"context_line":"        updated_pool[\u0027lb_method\u0027] \u003d \u0027LEAST_CONNECTIONS\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FWtA%3D","line":697,"updated":"2014-02-13 19:13:22.000000000","message":"updated_pool \u003d testpool.copy()","commit_id":"1f8e8d745eeef8abea17cc353d393db8df1f1374"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4ec75d9735cc53b3d230044595471553cbfd1eec","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright 2014 Citrix Systems"},{"line_number":4,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUX%2F%2Bg8M%3D","line":1,"updated":"2014-02-20 19:12:15.000000000","message":"ditto. Check any other files.","commit_id":"3a18ea220b134dd3b992acb4887a68679f139f8e"}]}
