)]}'
{"quantum/client/__init__.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        This routine generates the appropriate"},{"line_number":34,"context_line":"        Quantum exception according to the contents of the"},{"line_number":35,"context_line":"        response body"},{"line_number":36,"context_line":"        "},{"line_number":37,"context_line":"        :param status_code: HTTP error status code"},{"line_number":38,"context_line":"        :param error_content: deserialized body of error response"},{"line_number":39,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4vo%3D","line":36,"updated":"2012-02-20 18:37:02.000000000","message":"tab","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        if error_type:"},{"line_number":67,"context_line":"            error_dict \u003d error_content[error_type]"},{"line_number":68,"context_line":"            error_message \u003d error_dict[\u0027message\u0027] + \"\\n\" +\\"},{"line_number":69,"context_line":"                            error_dict[\u0027detail\u0027]"},{"line_number":70,"context_line":"    else:"},{"line_number":71,"context_line":"        error_message \u003d error_content"},{"line_number":72,"context_line":"    # raise the appropriate error!"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4vk%3D","line":69,"updated":"2012-02-20 18:37:02.000000000","message":"Seems like if error_type evaluates to False, error_message will never be set.  Is that intended?","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":66,"context_line":"        if error_type:"},{"line_number":67,"context_line":"            error_dict \u003d error_content[error_type]"},{"line_number":68,"context_line":"            error_message \u003d error_dict[\u0027message\u0027] + \"\\n\" +\\"},{"line_number":69,"context_line":"                            error_dict[\u0027detail\u0027]"},{"line_number":70,"context_line":"    else:"},{"line_number":71,"context_line":"        error_message \u003d error_content"},{"line_number":72,"context_line":"    # raise the appropriate error!"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4qc%3D","line":69,"in_reply_to":"AAAAEn%2F%2F4vk%3D","updated":"2012-02-20 23:09:51.000000000","message":"Quite, as by construction (at least in my mind), if the error response body is a dictionary, I am expecting the error to be a quantum-specific one. However, this is not guaranteed to be true!\nI\u0027ll therefore make sure there\u0027s a default error message in any case","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        This routine generates the appropriate"},{"line_number":83,"context_line":"        Quantum exception according to the contents of the"},{"line_number":84,"context_line":"        response body"},{"line_number":85,"context_line":"        "},{"line_number":86,"context_line":"        :param status_code: HTTP error status code"},{"line_number":87,"context_line":"        :param error_content: deserialized body of error response"},{"line_number":88,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4vg%3D","line":85,"updated":"2012-02-20 18:37:02.000000000","message":"tab","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                         message\u003derror_message)],)"},{"line_number":112,"context_line":"        raise ex"},{"line_number":113,"context_line":"    # If we end up here the exception was not a quantum error"},{"line_number":114,"context_line":"    raise exceptions.QuantumClientException(status_code + \"-\" + error_content)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"EXCEPTION_HANDLERS \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4vc%3D","line":114,"updated":"2012-02-20 18:37:02.000000000","message":"Can status_code be None?  The fact that status_code is included in the above if-check makes me think perhaps that is the case.  If so, we\u0027d need to check before potentially concatenating it with a string here.\n\nUpdate: from code below, looks like status code cannot be None, so perhaps this comment is more that the inclusion in the above if-check may not be needed.","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":111,"context_line":"                         message\u003derror_message)],)"},{"line_number":112,"context_line":"        raise ex"},{"line_number":113,"context_line":"    # If we end up here the exception was not a quantum error"},{"line_number":114,"context_line":"    raise exceptions.QuantumClientException(status_code + \"-\" + error_content)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"EXCEPTION_HANDLERS \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4qY%3D","line":114,"in_reply_to":"AAAAEn%2F%2F4vc%3D","updated":"2012-02-20 23:09:51.000000000","message":"I don\u0027t how status_code could be none, since it is taken from the HTTP response.\nI\u0027ll update the if condition","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":168,"context_line":"    def __init__(self, host\u003d\"127.0.0.1\", port\u003d9696, use_ssl\u003dFalse, tenant\u003dNone,"},{"line_number":169,"context_line":"                format\u003d\"xml\", testingStub\u003dNone, key_file\u003dNone, cert_file\u003dNone,"},{"line_number":170,"context_line":"                auth_token\u003dNone, logger\u003dNone,"},{"line_number":171,"context_line":"                version\u003d\"1.0\","},{"line_number":172,"context_line":"                uri_prefix\u003d\"/tenants/{tenant_id}\"):"},{"line_number":173,"context_line":"        \"\"\""},{"line_number":174,"context_line":"        Creates a new client to some service."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4vY%3D","line":171,"updated":"2012-02-20 18:37:02.000000000","message":"I think nova defaults to the newer version (i.e., 1.1).  I think that might be a reasonable thing to do.","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":168,"context_line":"    def __init__(self, host\u003d\"127.0.0.1\", port\u003d9696, use_ssl\u003dFalse, tenant\u003dNone,"},{"line_number":169,"context_line":"                format\u003d\"xml\", testingStub\u003dNone, key_file\u003dNone, cert_file\u003dNone,"},{"line_number":170,"context_line":"                auth_token\u003dNone, logger\u003dNone,"},{"line_number":171,"context_line":"                version\u003d\"1.0\","},{"line_number":172,"context_line":"                uri_prefix\u003d\"/tenants/{tenant_id}\"):"},{"line_number":173,"context_line":"        \"\"\""},{"line_number":174,"context_line":"        Creates a new client to some service."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4qU%3D","line":171,"in_reply_to":"AAAAEn%2F%2F4vY%3D","updated":"2012-02-20 23:09:51.000000000","message":"I wanted \"official\" approval :)","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":436,"context_line":"    This class overiddes some methods of the Client class in order to deal with"},{"line_number":437,"context_line":"    features specific to API v1.1 such as filters"},{"line_number":438,"context_line":"    \"\"\""},{"line_number":439,"context_line":"    "},{"line_number":440,"context_line":"    @ApiCall"},{"line_number":441,"context_line":"    def list_networks(self, **filters):"},{"line_number":442,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4vU%3D","line":439,"updated":"2012-02-20 18:37:02.000000000","message":"whitespace here and below","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7571c5882fdc1370ee5c72281ed577421e08c59a","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    # Find real error type"},{"line_number":65,"context_line":"    error_type \u003d None"},{"line_number":66,"context_line":"    if isinstance(error_content, dict):"},{"line_number":67,"context_line":"        error_type \u003d quantum_error_types.get(status_code, None)"},{"line_number":68,"context_line":"    if error_type is not None:"},{"line_number":69,"context_line":"        error_dict \u003d error_content[error_type]"},{"line_number":70,"context_line":"        error_message \u003d error_dict[\u0027message\u0027] + \"\\n\" +\\"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F35s%3D","line":67,"updated":"2012-02-22 04:39:04.000000000","message":"Suggestion - consider omitting None.","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":64,"context_line":"    # Find real error type"},{"line_number":65,"context_line":"    error_type \u003d None"},{"line_number":66,"context_line":"    if isinstance(error_content, dict):"},{"line_number":67,"context_line":"        error_type \u003d quantum_error_types.get(status_code, None)"},{"line_number":68,"context_line":"    if error_type is not None:"},{"line_number":69,"context_line":"        error_dict \u003d error_content[error_type]"},{"line_number":70,"context_line":"        error_message \u003d error_dict[\u0027message\u0027] + \"\\n\" +\\"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F3Rw%3D","line":67,"in_reply_to":"AAAAEn%2F%2F35s%3D","updated":"2012-02-22 22:06:12.000000000","message":"Done","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7571c5882fdc1370ee5c72281ed577421e08c59a","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    error_type \u003d None"},{"line_number":66,"context_line":"    if isinstance(error_content, dict):"},{"line_number":67,"context_line":"        error_type \u003d quantum_error_types.get(status_code, None)"},{"line_number":68,"context_line":"    if error_type is not None:"},{"line_number":69,"context_line":"        error_dict \u003d error_content[error_type]"},{"line_number":70,"context_line":"        error_message \u003d error_dict[\u0027message\u0027] + \"\\n\" +\\"},{"line_number":71,"context_line":"                        error_dict[\u0027detail\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F35o%3D","line":68,"updated":"2012-02-22 04:39:04.000000000","message":"Suggestion - consider using implicit boolean conversion.","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":65,"context_line":"    error_type \u003d None"},{"line_number":66,"context_line":"    if isinstance(error_content, dict):"},{"line_number":67,"context_line":"        error_type \u003d quantum_error_types.get(status_code, None)"},{"line_number":68,"context_line":"    if error_type is not None:"},{"line_number":69,"context_line":"        error_dict \u003d error_content[error_type]"},{"line_number":70,"context_line":"        error_message \u003d error_dict[\u0027message\u0027] + \"\\n\" +\\"},{"line_number":71,"context_line":"                        error_dict[\u0027detail\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F3R0%3D","line":68,"in_reply_to":"AAAAEn%2F%2F35o%3D","updated":"2012-02-22 22:06:12.000000000","message":"Done","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7571c5882fdc1370ee5c72281ed577421e08c59a","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        }"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    if isinstance(error_content, dict):"},{"line_number":102,"context_line":"        error_dict \u003d error_content.get(\u0027QuantumError\u0027, None)"},{"line_number":103,"context_line":"    # Find real error type"},{"line_number":104,"context_line":"    if error_dict:"},{"line_number":105,"context_line":"        # If QuantumError key is found, it will definitely contain"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F35k%3D","line":102,"updated":"2012-02-22 04:39:04.000000000","message":"Suggestion - consider omitting None.","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":99,"context_line":"        }"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    if isinstance(error_content, dict):"},{"line_number":102,"context_line":"        error_dict \u003d error_content.get(\u0027QuantumError\u0027, None)"},{"line_number":103,"context_line":"    # Find real error type"},{"line_number":104,"context_line":"    if error_dict:"},{"line_number":105,"context_line":"        # If QuantumError key is found, it will definitely contain"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F3R4%3D","line":102,"in_reply_to":"AAAAEn%2F%2F35k%3D","updated":"2012-02-22 22:06:12.000000000","message":"Done","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7571c5882fdc1370ee5c72281ed577421e08c59a","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    if isinstance(error_content, dict):"},{"line_number":102,"context_line":"        error_dict \u003d error_content.get(\u0027QuantumError\u0027, None)"},{"line_number":103,"context_line":"    # Find real error type"},{"line_number":104,"context_line":"    if error_dict:"},{"line_number":105,"context_line":"        # If QuantumError key is found, it will definitely contain"},{"line_number":106,"context_line":"        # a \u0027message\u0027 and \u0027type\u0027 keys"},{"line_number":107,"context_line":"        error_type \u003d error_dict[\u0027type\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F35g%3D","line":104,"updated":"2012-02-22 04:39:04.000000000","message":"If the error_content is not a dict, this line will result in a NameError.  I\u0027m assuming the intent was to have \u0027error_dict \u003d None\u0027 precede line 101.","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":101,"context_line":"    if isinstance(error_content, dict):"},{"line_number":102,"context_line":"        error_dict \u003d error_content.get(\u0027QuantumError\u0027, None)"},{"line_number":103,"context_line":"    # Find real error type"},{"line_number":104,"context_line":"    if error_dict:"},{"line_number":105,"context_line":"        # If QuantumError key is found, it will definitely contain"},{"line_number":106,"context_line":"        # a \u0027message\u0027 and \u0027type\u0027 keys"},{"line_number":107,"context_line":"        error_type \u003d error_dict[\u0027type\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F3R8%3D","line":104,"in_reply_to":"AAAAEn%2F%2F35g%3D","updated":"2012-02-22 22:06:12.000000000","message":"Error_dict, which is the content of \"QuantumError\" is by construction a dict. An extra check will not do any harm though.","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7571c5882fdc1370ee5c72281ed577421e08c59a","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        # If QuantumError key is found, it will definitely contain"},{"line_number":106,"context_line":"        # a \u0027message\u0027 and \u0027type\u0027 keys"},{"line_number":107,"context_line":"        error_type \u003d error_dict[\u0027type\u0027]"},{"line_number":108,"context_line":"        error_message \u003d error_dict[\u0027message\u0027] + \"\\n\" +\\"},{"line_number":109,"context_line":"                        error_dict[\u0027detail\u0027]"},{"line_number":110,"context_line":"        # raise the appropriate error!"},{"line_number":111,"context_line":"        ex \u003d quantum_errors[error_type](message\u003derror_message)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F35U%3D","line":108,"updated":"2012-02-22 04:39:04.000000000","message":"Prefer parenthesis to backslashes for line continuation.","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":105,"context_line":"        # If QuantumError key is found, it will definitely contain"},{"line_number":106,"context_line":"        # a \u0027message\u0027 and \u0027type\u0027 keys"},{"line_number":107,"context_line":"        error_type \u003d error_dict[\u0027type\u0027]"},{"line_number":108,"context_line":"        error_message \u003d error_dict[\u0027message\u0027] + \"\\n\" +\\"},{"line_number":109,"context_line":"                        error_dict[\u0027detail\u0027]"},{"line_number":110,"context_line":"        # raise the appropriate error!"},{"line_number":111,"context_line":"        ex \u003d quantum_errors[error_type](message\u003derror_message)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F3SE%3D","line":108,"in_reply_to":"AAAAEn%2F%2F35U%3D","updated":"2012-02-22 22:06:12.000000000","message":"Done","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7571c5882fdc1370ee5c72281ed577421e08c59a","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        \u0027AlreadyAttached\u0027: exceptions.AlreadyAttachedClient,"},{"line_number":99,"context_line":"        }"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    error_dict \u003d None"},{"line_number":102,"context_line":"    if isinstance(error_content, dict):"},{"line_number":103,"context_line":"        error_dict \u003d error_content.get(\u0027QuantumError\u0027)"},{"line_number":104,"context_line":"    # Find real error type"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAEn%2F%2F1bk%3D","line":101,"updated":"2012-02-28 01:14:05.000000000","message":"To reiterate my comment on the previous revision, line 101 is required to ensure that line 105 does not result in a NameError if line 103 does not get executed.","commit_id":"f6d50876985ed9a392fa49dda9c0fc4108a2ac8d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7571c5882fdc1370ee5c72281ed577421e08c59a","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        # If QuantumError key is found, it will definitely contain"},{"line_number":107,"context_line":"        # a \u0027message\u0027 and \u0027type\u0027 keys"},{"line_number":108,"context_line":"        error_type \u003d error_dict[\u0027type\u0027]"},{"line_number":109,"context_line":"        error_message \u003d (error_dict[\u0027message\u0027] + \"\\n\" +"},{"line_number":110,"context_line":"                         error_dict[\u0027detail\u0027])"},{"line_number":111,"context_line":"        # raise the appropriate error!"},{"line_number":112,"context_line":"        ex \u003d quantum_errors[error_type](message\u003derror_message)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAEn%2F%2F1bo%3D","line":109,"updated":"2012-02-28 01:14:05.000000000","message":"Prefer string formatting to concatenation.","commit_id":"f6d50876985ed9a392fa49dda9c0fc4108a2ac8d"}],"quantum/client/cli.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","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 2011 Nicira Networks, Inc."},{"line_number":4,"context_line":"# Copyright 2011 Citrix Systems"},{"line_number":5,"context_line":"#"},{"line_number":6,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":7,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4ss%3D","line":4,"updated":"2012-02-20 18:37:02.000000000","message":"changes seem significant enough to update copyright date.","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"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 2011 Nicira Networks, Inc."},{"line_number":4,"context_line":"# Copyright 2011 Citrix Systems"},{"line_number":5,"context_line":"#"},{"line_number":6,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":7,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4qQ%3D","line":4,"in_reply_to":"AAAAEn%2F%2F4ss%3D","updated":"2012-02-20 23:09:51.000000000","message":"Right","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":44,"context_line":"#NOTE(salvatore-orlando): logger name does not map to package"},{"line_number":45,"context_line":"#this is deliberate. Simplifies logger configuration"},{"line_number":46,"context_line":"LOG \u003d logging.getLogger(\u0027quantum\u0027)"},{"line_number":47,"context_line":"DEFAULT_QUANTUM_VERSION \u003d \u00271.0\u0027"},{"line_number":48,"context_line":"FORMAT \u003d \u0027json\u0027"},{"line_number":49,"context_line":"commands_v10 \u003d {"},{"line_number":50,"context_line":"  \"list_nets\": {"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4s8%3D","line":47,"updated":"2012-02-20 18:37:02.000000000","message":"I think python-novaclient defaults to 1.1","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":44,"context_line":"#NOTE(salvatore-orlando): logger name does not map to package"},{"line_number":45,"context_line":"#this is deliberate. Simplifies logger configuration"},{"line_number":46,"context_line":"LOG \u003d logging.getLogger(\u0027quantum\u0027)"},{"line_number":47,"context_line":"DEFAULT_QUANTUM_VERSION \u003d \u00271.0\u0027"},{"line_number":48,"context_line":"FORMAT \u003d \u0027json\u0027"},{"line_number":49,"context_line":"commands_v10 \u003d {"},{"line_number":50,"context_line":"  \"list_nets\": {"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4qM%3D","line":47,"in_reply_to":"AAAAEn%2F%2F4s8%3D","updated":"2012-02-20 23:09:51.000000000","message":"Done","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        for x in cmdargs:"},{"line_number":124,"context_line":"            args.append(arglist[0])"},{"line_number":125,"context_line":"            del arglist[0]"},{"line_number":126,"context_line":"        args.append(version)"},{"line_number":127,"context_line":"    except:"},{"line_number":128,"context_line":"        LOG.error(\"Not enough arguments for \\\"%s\\\" (expected: %d, got: %d)\" % ("},{"line_number":129,"context_line":"          cmd, len(cmdargs), arglist_len))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4t8%3D","line":126,"updated":"2012-02-20 18:37:02.000000000","message":"I think this method could be more clearly written along the lines of: \n\nc \u003d len(cmdargs)\nif len(arglist) \u003c c:  \n  Not enough args....\narglist \u003d arglist[c:]\nreturn arglist[:c]","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":123,"context_line":"        for x in cmdargs:"},{"line_number":124,"context_line":"            args.append(arglist[0])"},{"line_number":125,"context_line":"            del arglist[0]"},{"line_number":126,"context_line":"        args.append(version)"},{"line_number":127,"context_line":"    except:"},{"line_number":128,"context_line":"        LOG.error(\"Not enough arguments for \\\"%s\\\" (expected: %d, got: %d)\" % ("},{"line_number":129,"context_line":"          cmd, len(cmdargs), arglist_len))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4qI%3D","line":126,"in_reply_to":"AAAAEn%2F%2F4t8%3D","updated":"2012-02-20 23:09:51.000000000","message":"Done","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        if len(split_filter) !\u003d 2:"},{"line_number":141,"context_line":"            LOG.error(\"Invalid argument detected: %s\", flt)"},{"line_number":142,"context_line":"            print_usage(cmd, version)"},{"line_number":143,"context_line":"            return None"},{"line_number":144,"context_line":"        filter_key, filter_value \u003d split_filter"},{"line_number":145,"context_line":"        # Ensure the filter is allowed"},{"line_number":146,"context_line":"        if not filter_key in cmd_filters:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4vE%3D","line":143,"updated":"2012-02-20 18:37:02.000000000","message":"Looks like build_cmd below will continue if build_filters returns None.  Might be better to abort with an error here, as the CLI is clearly not able to interpret the user\u0027s intent.","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":140,"context_line":"        if len(split_filter) !\u003d 2:"},{"line_number":141,"context_line":"            LOG.error(\"Invalid argument detected: %s\", flt)"},{"line_number":142,"context_line":"            print_usage(cmd, version)"},{"line_number":143,"context_line":"            return None"},{"line_number":144,"context_line":"        filter_key, filter_value \u003d split_filter"},{"line_number":145,"context_line":"        # Ensure the filter is allowed"},{"line_number":146,"context_line":"        if not filter_key in cmd_filters:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4qE%3D","line":143,"in_reply_to":"AAAAEn%2F%2F4vE%3D","updated":"2012-02-20 23:09:51.000000000","message":"Done","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        # Ensure the filter is allowed"},{"line_number":146,"context_line":"        if not filter_key in cmd_filters:"},{"line_number":147,"context_line":"            LOG.error(\"Invalid filter key: %s\", filter_key)"},{"line_number":148,"context_line":"            print_usage(cmd, version)"},{"line_number":149,"context_line":"        filters[filter_key] \u003d filter_value"},{"line_number":150,"context_line":"    return filters"},{"line_number":151,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4vQ%3D","line":148,"updated":"2012-02-20 18:37:02.000000000","message":"seems like there should be a continue/return/exception here, as we probably don\u0027t want to use the invalid filter key (similar to above comment)","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":145,"context_line":"        # Ensure the filter is allowed"},{"line_number":146,"context_line":"        if not filter_key in cmd_filters:"},{"line_number":147,"context_line":"            LOG.error(\"Invalid filter key: %s\", filter_key)"},{"line_number":148,"context_line":"            print_usage(cmd, version)"},{"line_number":149,"context_line":"        filters[filter_key] \u003d filter_value"},{"line_number":150,"context_line":"    return filters"},{"line_number":151,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4qA%3D","line":148,"in_reply_to":"AAAAEn%2F%2F4vQ%3D","updated":"2012-02-20 23:09:51.000000000","message":"Done","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    return filters"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"def build_cmd(cmd, cmd_args, cmd_filters, arglist, version):"},{"line_number":154,"context_line":"    arglist_len \u003d len(arglist)"},{"line_number":155,"context_line":"    # Parse arguments"},{"line_number":156,"context_line":"    args \u003d build_args(cmd, cmd_args, arglist, version)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4uQ%3D","line":153,"updated":"2012-02-20 18:37:02.000000000","message":"originally misunderstood this function, as cmd_filters is actually the set possible filter values, not the actual set of filters.  Doc-string might make this more clear.","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":150,"context_line":"    return filters"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"def build_cmd(cmd, cmd_args, cmd_filters, arglist, version):"},{"line_number":154,"context_line":"    arglist_len \u003d len(arglist)"},{"line_number":155,"context_line":"    # Parse arguments"},{"line_number":156,"context_line":"    args \u003d build_args(cmd, cmd_args, arglist, version)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4p8%3D","line":153,"in_reply_to":"AAAAEn%2F%2F4uQ%3D","updated":"2012-02-20 23:09:51.000000000","message":"Done","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    filters \u003d None"},{"line_number":159,"context_line":"    if cmd_filters and len(cmd_filters)\u003e0:"},{"line_number":160,"context_line":"        filters \u003d build_filters(cmd, cmd_filters, arglist, version)"},{"line_number":161,"context_line":"    filter_len \u003d filters is not None and len(filters) or 0"},{"line_number":162,"context_line":"    if len(arglist) - filter_len \u003e 0:"},{"line_number":163,"context_line":"        LOG.error(\"Too many arguments for \\\"%s\\\" (expected: %d, got: %d)\" % ("},{"line_number":164,"context_line":"          cmd, len(cmd_args), arglist_len))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4u8%3D","line":161,"updated":"2012-02-20 18:37:02.000000000","message":"more parens would make logic more obvious.","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":158,"context_line":"    filters \u003d None"},{"line_number":159,"context_line":"    if cmd_filters and len(cmd_filters)\u003e0:"},{"line_number":160,"context_line":"        filters \u003d build_filters(cmd, cmd_filters, arglist, version)"},{"line_number":161,"context_line":"    filter_len \u003d filters is not None and len(filters) or 0"},{"line_number":162,"context_line":"    if len(arglist) - filter_len \u003e 0:"},{"line_number":163,"context_line":"        LOG.error(\"Too many arguments for \\\"%s\\\" (expected: %d, got: %d)\" % ("},{"line_number":164,"context_line":"          cmd, len(cmd_args), arglist_len))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4p4%3D","line":161,"in_reply_to":"AAAAEn%2F%2F4u8%3D","updated":"2012-02-20 23:09:51.000000000","message":"Done","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":177,"context_line":"    elif version \u003d\u003d \"1.1\":"},{"line_number":178,"context_line":"        client \u003d ClientV11(host, port, ssl, tenant, FORMAT,"},{"line_number":179,"context_line":"                           auth_token\u003dtoken,"},{"line_number":180,"context_line":"                           version\u003dversion)"},{"line_number":181,"context_line":"    return client"},{"line_number":182,"context_line":"    "},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4u0%3D","line":180,"updated":"2012-02-20 18:37:02.000000000","message":"Seems a bit odd that we don\u0027t handle case for other versions here, but it looks like logic below checks that version if either 1.0 or 1.1 (though by checking the commands dict).\n\nMight be nice if there was a better way of coupling the versions in commands array with the set of client classes used to implement those commands, but isn\u0027t necessary","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":177,"context_line":"    elif version \u003d\u003d \"1.1\":"},{"line_number":178,"context_line":"        client \u003d ClientV11(host, port, ssl, tenant, FORMAT,"},{"line_number":179,"context_line":"                           auth_token\u003dtoken,"},{"line_number":180,"context_line":"                           version\u003dversion)"},{"line_number":181,"context_line":"    return client"},{"line_number":182,"context_line":"    "},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4p0%3D","line":180,"in_reply_to":"AAAAEn%2F%2F4u0%3D","updated":"2012-02-20 23:09:51.000000000","message":"I admit this was a quick and dirty way. I\u0027ll do something along the lines of what I did for cli output, cli commands, etc.","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                           auth_token\u003dtoken,"},{"line_number":180,"context_line":"                           version\u003dversion)"},{"line_number":181,"context_line":"    return client"},{"line_number":182,"context_line":"    "},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"def main():"},{"line_number":185,"context_line":"    usagestr \u003d \"Usage: %prog [OPTIONS] \u003ccommand\u003e [args]\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4uw%3D","line":182,"updated":"2012-02-20 18:37:02.000000000","message":"whitespace","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":198,"context_line":"      type\u003d\"string\", default\u003dNone, help\u003d\"authentication token\")"},{"line_number":199,"context_line":"    parser.add_option(\u0027--version\u0027,"},{"line_number":200,"context_line":"        default\u003dutils.env(\u0027QUANTUM_VERSION\u0027, default\u003dDEFAULT_QUANTUM_VERSION),"},{"line_number":201,"context_line":"        help\u003d\u0027Accepts 1.1 and 1.0, defaults to env[NOVA_VERSION].\u0027)"},{"line_number":202,"context_line":"    options, args \u003d parser.parse_args()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    if options.verbose:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4tA%3D","line":201,"updated":"2012-02-20 18:37:02.000000000","message":"I think this should be env[QUANTUM_VERSION] ?","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":198,"context_line":"      type\u003d\"string\", default\u003dNone, help\u003d\"authentication token\")"},{"line_number":199,"context_line":"    parser.add_option(\u0027--version\u0027,"},{"line_number":200,"context_line":"        default\u003dutils.env(\u0027QUANTUM_VERSION\u0027, default\u003dDEFAULT_QUANTUM_VERSION),"},{"line_number":201,"context_line":"        help\u003d\u0027Accepts 1.1 and 1.0, defaults to env[NOVA_VERSION].\u0027)"},{"line_number":202,"context_line":"    options, args \u003d parser.parse_args()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    if options.verbose:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4pw%3D","line":201,"in_reply_to":"AAAAEn%2F%2F4tA%3D","updated":"2012-02-20 23:09:51.000000000","message":"I\u0027m bad at cut\u0026paste:)","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":218,"context_line":"    if not version in commands:"},{"line_number":219,"context_line":"        LOG.error(\"Unknown API version specified:%s\", version)"},{"line_number":220,"context_line":"        print \"Unknown API version: %s\" % version"},{"line_number":221,"context_line":"    "},{"line_number":222,"context_line":"    if len(args) \u003c 1:"},{"line_number":223,"context_line":"        parser.print_help()"},{"line_number":224,"context_line":"        help(version)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4uo%3D","line":221,"updated":"2012-02-20 18:37:02.000000000","message":"more whitespace.","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7571c5882fdc1370ee5c72281ed577421e08c59a","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        args \u003d build_args(cmd, cmd_args, arglist)"},{"line_number":168,"context_line":"        # Parse filters"},{"line_number":169,"context_line":"        filters \u003d None"},{"line_number":170,"context_line":"        if cmd_filters and len(cmd_filters) \u003e 0:"},{"line_number":171,"context_line":"            # Pop consumed arguments"},{"line_number":172,"context_line":"            arglist \u003d arglist[len(args):]"},{"line_number":173,"context_line":"            filters \u003d build_filters(cmd, cmd_filters, arglist, version)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F350%3D","line":170,"updated":"2012-02-22 04:39:04.000000000","message":"Suggestion - consider using implicit boolean conversion - \u0027if cmd_filters:\u0027 is equivalent to the current statement.","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":167,"context_line":"        args \u003d build_args(cmd, cmd_args, arglist)"},{"line_number":168,"context_line":"        # Parse filters"},{"line_number":169,"context_line":"        filters \u003d None"},{"line_number":170,"context_line":"        if cmd_filters and len(cmd_filters) \u003e 0:"},{"line_number":171,"context_line":"            # Pop consumed arguments"},{"line_number":172,"context_line":"            arglist \u003d arglist[len(args):]"},{"line_number":173,"context_line":"            filters \u003d build_filters(cmd, cmd_filters, arglist, version)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F3Rg%3D","line":170,"in_reply_to":"AAAAEn%2F%2F350%3D","updated":"2012-02-22 22:06:12.000000000","message":"Done","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7571c5882fdc1370ee5c72281ed577421e08c59a","unresolved":false,"context_lines":[{"line_number":269,"context_line":"    # append filters to arguments"},{"line_number":270,"context_line":"    # this will allow for using the same prototype for v10 and v11"},{"line_number":271,"context_line":"    # TODO: Use **kwargs instead of *args (keyword is better than positional)"},{"line_number":272,"context_line":"    if filters is not None and len(filters) \u003e 0:"},{"line_number":273,"context_line":"        args.append(filters)"},{"line_number":274,"context_line":"    commands[version][cmd][\"func\"](client, *args)"},{"line_number":275,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F35w%3D","line":272,"updated":"2012-02-22 04:39:04.000000000","message":"Suggestion - consider using implicit boolean conversion.","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":269,"context_line":"    # append filters to arguments"},{"line_number":270,"context_line":"    # this will allow for using the same prototype for v10 and v11"},{"line_number":271,"context_line":"    # TODO: Use **kwargs instead of *args (keyword is better than positional)"},{"line_number":272,"context_line":"    if filters is not None and len(filters) \u003e 0:"},{"line_number":273,"context_line":"        args.append(filters)"},{"line_number":274,"context_line":"    commands[version][cmd][\"func\"](client, *args)"},{"line_number":275,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F3Rc%3D","line":272,"in_reply_to":"AAAAEn%2F%2F35w%3D","updated":"2012-02-22 22:06:12.000000000","message":"Done","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"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 2012 Nicira Networks, Inc."},{"line_number":4,"context_line":"# Copyright 2012 Citrix Systems"},{"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":"AAAAEn%2F%2F2hc%3D","line":3,"updated":"2012-02-24 00:18:50.000000000","message":"technically, i think we should keep the old copyright date, and add the new one.  I\u0027m fine if you don\u0027t change it here, but thought I would mention it for future reference.","commit_id":"f6d50876985ed9a392fa49dda9c0fc4108a2ac8d"}],"quantum/client/cli_lib.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":"def list_nets_v11(client, *args):"},{"line_number":195,"context_line":"    filters \u003d {}"},{"line_number":196,"context_line":"    if isinstance(args[-1], dict):"},{"line_number":197,"context_line":"        filters \u003d args[-1]"},{"line_number":198,"context_line":"    tenant_id, version \u003d args[:-1]"},{"line_number":199,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4tk%3D","line":196,"updated":"2012-02-20 18:37:02.000000000","message":"I think we both agree that kwargs is the right way to go in general.  In short-term, seems like checking len(args) might be cleaner than checking the type (in case another arg was added latter that was also a dict).","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":"def list_nets_v11(client, *args):"},{"line_number":195,"context_line":"    filters \u003d {}"},{"line_number":196,"context_line":"    if isinstance(args[-1], dict):"},{"line_number":197,"context_line":"        filters \u003d args[-1]"},{"line_number":198,"context_line":"    tenant_id, version \u003d args[:-1]"},{"line_number":199,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4ps%3D","line":196,"in_reply_to":"AAAAEn%2F%2F4tk%3D","updated":"2012-02-20 23:09:51.000000000","message":"Done","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":296,"context_line":"        print output"},{"line_number":297,"context_line":"    except Exception as ex:"},{"line_number":298,"context_line":"        _handle_exception(ex)"},{"line_number":299,"context_line":"        "},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"def create_port(client, *args):"},{"line_number":302,"context_line":"    tenant_id, network_id, version \u003d args"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4tg%3D","line":299,"updated":"2012-02-20 18:37:02.000000000","message":"whitespace","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"}],"quantum/common/exceptions.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":96,"context_line":""},{"line_number":97,"context_line":"# NOTE: on the client side, we use different exception types in order"},{"line_number":98,"context_line":"# to allow client library users to handle server exceptions in try...except"},{"line_number":99,"context_line":"# blocks. The actual error message is the one generated on the server side"},{"line_number":100,"context_line":"class NetworkNotFoundClient(QuantumClientException):"},{"line_number":101,"context_line":"    pass"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4tU%3D","line":99,"updated":"2012-02-20 18:37:02.000000000","message":"Would it make sense to put client exceptions in a different file, so that we get closer to no longer needing a shared quantum.common package for both client and server?","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":96,"context_line":""},{"line_number":97,"context_line":"# NOTE: on the client side, we use different exception types in order"},{"line_number":98,"context_line":"# to allow client library users to handle server exceptions in try...except"},{"line_number":99,"context_line":"# blocks. The actual error message is the one generated on the server side"},{"line_number":100,"context_line":"class NetworkNotFoundClient(QuantumClientException):"},{"line_number":101,"context_line":"    pass"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4po%3D","line":99,"in_reply_to":"AAAAEn%2F%2F4tU%3D","updated":"2012-02-20 23:09:51.000000000","message":"Sounds good to me. Best way of doing this would be to file a bug report, and push two changeset (one to add server-side exceptions in quantum repo, and another for removing them from python-quantumclient)","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"}],"quantum/common/utils.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"f68eec5f495e2b9a38e02ab76e244e0634cc7b41","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        if value:"},{"line_number":54,"context_line":"            return value"},{"line_number":55,"context_line":"    return kwargs.get(\u0027default\u0027, \u0027\u0027)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def import_class(import_str):"},{"line_number":59,"context_line":"    \"\"\"Returns a class from a string including module and class.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAEn%2F%2F4sw%3D","line":56,"updated":"2012-02-20 18:37:02.000000000","message":"Great that you\u0027re adding this... been on my todo list for a while.  In the future, I\u0027d like to be able to get tenant-id, username, key, etc. all via the environment, similar to python-novaclient.  Ideally, we would even make it so that the user only needed to specify things like keystone credentials once, and then could use nova, glance, quantum clients.","commit_id":"68d0c8520505263a4ba2cce2aa535e5cf7e7143e"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7571c5882fdc1370ee5c72281ed577421e08c59a","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    if none are non-empty, defaults to \u0027\u0027 or keyword arg default"},{"line_number":50,"context_line":"    \"\"\""},{"line_number":51,"context_line":"    for v in vars:"},{"line_number":52,"context_line":"        value \u003d os.environ.get(v, None)"},{"line_number":53,"context_line":"        if value:"},{"line_number":54,"context_line":"            return value"},{"line_number":55,"context_line":"    return kwargs.get(\u0027default\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F36M%3D","line":52,"updated":"2012-02-22 04:39:04.000000000","message":"Suggestion - consider omitting None.","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":49,"context_line":"    if none are non-empty, defaults to \u0027\u0027 or keyword arg default"},{"line_number":50,"context_line":"    \"\"\""},{"line_number":51,"context_line":"    for v in vars:"},{"line_number":52,"context_line":"        value \u003d os.environ.get(v, None)"},{"line_number":53,"context_line":"        if value:"},{"line_number":54,"context_line":"            return value"},{"line_number":55,"context_line":"    return kwargs.get(\u0027default\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAEn%2F%2F3RM%3D","line":52,"in_reply_to":"AAAAEn%2F%2F36M%3D","updated":"2012-02-22 22:06:12.000000000","message":"Done","commit_id":"03434c8fea2413590fc6715aa196dd69d0fda457"}]}
