)]}'
{"openstackclient/common/utils.py":[{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"c3354ede38e49e91d69cd878920a515691d69f5c","unresolved":false,"context_lines":[{"line_number":429,"context_line":"        return False"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":""},{"line_number":432,"context_line":"def add_long_list_option(parser):"},{"line_number":433,"context_line":"    parser.add_argument("},{"line_number":434,"context_line":"        \u0027--long\u0027,"},{"line_number":435,"context_line":"        action\u003d\u0027store_true\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_d0bc2fbd","line":432,"updated":"2016-02-29 23:29:08.000000000","message":"I don\u0027t like this either...","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c3c7fa71645ad08c5643180fe88775f0cce1f463","unresolved":false,"context_lines":[{"line_number":429,"context_line":"        return False"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":""},{"line_number":432,"context_line":"def add_long_list_option(parser):"},{"line_number":433,"context_line":"    parser.add_argument("},{"line_number":434,"context_line":"        \u0027--long\u0027,"},{"line_number":435,"context_line":"        action\u003d\u0027store_true\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_c3602404","line":432,"in_reply_to":"7af24918_82b468d1","updated":"2016-03-03 00:27:08.000000000","message":"@Akihiro:\nA common class can be created which would be inherited by all the List classes, if that is required.\nHowever, I felt that creating a class for a single function is too much, so went with a function","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"45b8fe2c25871f9ab082d4152dc1b92266a87905","unresolved":false,"context_lines":[{"line_number":429,"context_line":"        return False"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":""},{"line_number":432,"context_line":"def add_long_list_option(parser):"},{"line_number":433,"context_line":"    parser.add_argument("},{"line_number":434,"context_line":"        \u0027--long\u0027,"},{"line_number":435,"context_line":"        action\u003d\u0027store_true\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_82b468d1","line":432,"in_reply_to":"9aed3d3a_6b973648","updated":"2016-03-03 00:07:57.000000000","message":"If most list commands defines this option, it should be done in a common class. Just defining a common method does not solve the problem.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"0a5e6dd4104af90ea3680084c169ca2bd68546aa","unresolved":false,"context_lines":[{"line_number":429,"context_line":"        return False"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":""},{"line_number":432,"context_line":"def add_long_list_option(parser):"},{"line_number":433,"context_line":"    parser.add_argument("},{"line_number":434,"context_line":"        \u0027--long\u0027,"},{"line_number":435,"context_line":"        action\u003d\u0027store_true\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_6b973648","line":432,"in_reply_to":"9aed3d3a_d0bc2fbd","updated":"2016-02-29 23:54:14.000000000","message":"@Dean:\nI would appreciate if you could provide me a reason for not having this at a centralized location.\nThis is just an option, infact an option which is used by almost all List CLIs.That means a lot of common code, for something which does not Update/Set/Create any variable and just modifies the output.\nBut still, I would like to take each and every option on a case-by-case basis, which would ensure that there is not too much complexity, while also reducing the amount of common functions we have.\n\nAwaiting your response.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"c3354ede38e49e91d69cd878920a515691d69f5c","unresolved":false,"context_lines":[{"line_number":438,"context_line":"    )"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"# String conversion to provide case-independence"},{"line_number":442,"context_line":"def convert_to_upper(string):"},{"line_number":443,"context_line":"    return string.upper()"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_50a2df99","line":441,"updated":"2016-02-29 23:29:08.000000000","message":"Why do we need these?  Really, this is overboard","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c3c7fa71645ad08c5643180fe88775f0cce1f463","unresolved":false,"context_lines":[{"line_number":438,"context_line":"    )"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"# String conversion to provide case-independence"},{"line_number":442,"context_line":"def convert_to_upper(string):"},{"line_number":443,"context_line":"    return string.upper()"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_e3a56047","line":441,"in_reply_to":"7af24918_7d2461ae","updated":"2016-03-03 00:27:08.000000000","message":"@Akihiro: \nAgreed with this.\nHowever, this functionality is at the disposal of the developer, and if they want to use it, they can.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"45b8fe2c25871f9ab082d4152dc1b92266a87905","unresolved":false,"context_lines":[{"line_number":438,"context_line":"    )"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"# String conversion to provide case-independence"},{"line_number":442,"context_line":"def convert_to_upper(string):"},{"line_number":443,"context_line":"    return string.upper()"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_7d2461ae","line":441,"in_reply_to":"9aed3d3a_0b7f8a66","updated":"2016-03-03 00:07:57.000000000","message":"IMO it should be discussed separately as a whole policy of openstack client.\n\nLet me share some background in neutronclient.\n\nIn Mitaka cycle, a complain about case sensitive for choice fields were suddenly raised in neutronclient from some contributors. I accepted the patch as I have no strong opinion on this in neutronclient.\n\nIn OSC, we need to discuss it as a whole because it affects all existing comamnds potentially. It is not important with compatibility with neutron CLI. \"neutron CLI behaves so\" is not a reasonable reason.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"0a5e6dd4104af90ea3680084c169ca2bd68546aa","unresolved":false,"context_lines":[{"line_number":438,"context_line":"    )"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"# String conversion to provide case-independence"},{"line_number":442,"context_line":"def convert_to_upper(string):"},{"line_number":443,"context_line":"    return string.upper()"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_0b7f8a66","line":441,"in_reply_to":"9aed3d3a_50a2df99","updated":"2016-02-29 23:54:14.000000000","message":"Hi Dean,\nThe reason for putting this function here is to allow the user to provide input in any casing format he/she wants.\nThat ways, if the CLI accepts TCP, but user inputs \u0027tcp\u0027 or \u0027Tcp\u0027 , it would still work.\nIt seems odd that user has to follow the exact capitalization for a CLI.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"}],"openstackclient/network/utils.py":[{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"0bef2a8bc5774882a40f577616a5132424c134b4","unresolved":false,"context_lines":[{"line_number":15,"context_line":"import argparse"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"def add_admin_state_option(parser, **kwargs):"},{"line_number":19,"context_line":"    admin_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":20,"context_line":"    default_enable \u003d kwargs.pop(\u0027default_enable\u0027, argparse.SUPPRESS)"},{"line_number":21,"context_line":"    default_disable \u003d kwargs.pop(\u0027default_disable\u0027, argparse.SUPPRESS)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bae84128_d902420b","line":18,"range":{"start_line":18,"start_character":37,"end_line":18,"end_character":43},"updated":"2016-02-25 02:08:34.000000000","message":"We\u0027d better add some doc to tell users what kv could be put in the kwargs and what they mean.","commit_id":"e5cd80cc3edb4dc30411eb6b90c1a7731d478753"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"0bef2a8bc5774882a40f577616a5132424c134b4","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def add_share_option(parser, **kwargs):"},{"line_number":39,"context_line":"    share_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":40,"context_line":"    default_share \u003d kwargs.pop(\u0027default_share\u0027, None)"},{"line_number":41,"context_line":"    default_no_share \u003d kwargs.pop(\u0027default_no_share\u0027, argparse.SUPPRESS)"},{"line_number":42,"context_line":"    share_group.add_argument("},{"line_number":43,"context_line":"        \u0027--share\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bae84128_9c36e8e5","line":40,"range":{"start_line":40,"start_character":48,"end_line":40,"end_character":52},"updated":"2016-02-25 02:08:34.000000000","message":"Not argparse.SUPPRESS ?","commit_id":"e5cd80cc3edb4dc30411eb6b90c1a7731d478753"},{"author":{"_account_id":18658,"name":"Jas Singh","email":"singhj@us.ibm.com","username":"singhj"},"change_message_id":"666fc25d1d9c097099eaeb97af6cdb5fb15f05b2","unresolved":false,"context_lines":[{"line_number":21,"context_line":"        dest\u003d\u0027admin_state\u0027,"},{"line_number":22,"context_line":"        action\u003d\u0027store_true\u0027,"},{"line_number":23,"context_line":"        default\u003dNone if not is_create else is_create,"},{"line_number":24,"context_line":"        help\u003d(\u0027Enable %s (default)\u0027 % \u0027resource\u0027),"},{"line_number":25,"context_line":"    )"},{"line_number":26,"context_line":"    admin_group.add_argument("},{"line_number":27,"context_line":"        \u0027--disable\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_5936fe52","line":24,"range":{"start_line":24,"start_character":38,"end_line":24,"end_character":48},"updated":"2016-02-26 17:12:25.000000000","message":"I\u0027m sure you didn\u0027t mean to use a literal string here (also applies to subsequent help text below).","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f6846b3a07405d133c37f2630ee889221a73cecb","unresolved":false,"context_lines":[{"line_number":21,"context_line":"        dest\u003d\u0027admin_state\u0027,"},{"line_number":22,"context_line":"        action\u003d\u0027store_true\u0027,"},{"line_number":23,"context_line":"        default\u003dNone if not is_create else is_create,"},{"line_number":24,"context_line":"        help\u003d(\u0027Enable %s (default)\u0027 % \u0027resource\u0027),"},{"line_number":25,"context_line":"    )"},{"line_number":26,"context_line":"    admin_group.add_argument("},{"line_number":27,"context_line":"        \u0027--disable\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_d8d3ec02","line":24,"range":{"start_line":24,"start_character":38,"end_line":24,"end_character":48},"in_reply_to":"9aed3d3a_5936fe52","updated":"2016-02-29 08:15:31.000000000","message":"Done","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1613d08aeb601b585397b66512e241e86cdc8482","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    )"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"def add_long_list_option(parser):"},{"line_number":52,"context_line":"    parser.add_argument("},{"line_number":53,"context_line":"        \u0027--long\u0027,"},{"line_number":54,"context_line":"        action\u003d\u0027store_true\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_277da7e7","line":51,"updated":"2016-02-28 16:45:00.000000000","message":"--long is not specific to network-related commands.\nIt should be moved to more common place.\n\nFor example, openstack server list has --long option.\nhttp://docs.openstack.org/developer/python-openstackclient/command-objects/server.html#server-list","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f6846b3a07405d133c37f2630ee889221a73cecb","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    )"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"def add_long_list_option(parser):"},{"line_number":52,"context_line":"    parser.add_argument("},{"line_number":53,"context_line":"        \u0027--long\u0027,"},{"line_number":54,"context_line":"        action\u003d\u0027store_true\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_b8f7088a","line":51,"in_reply_to":"9aed3d3a_277da7e7","updated":"2016-02-29 08:15:31.000000000","message":"Moved","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"},{"author":{"_account_id":18658,"name":"Jas Singh","email":"singhj@us.ibm.com","username":"singhj"},"change_message_id":"666fc25d1d9c097099eaeb97af6cdb5fb15f05b2","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    )"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"# String conversion to provide case-independence"},{"line_number":71,"context_line":"def convert_to_upper(string):"},{"line_number":72,"context_line":"    return string.upper()"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def convert_to_lower(string):"},{"line_number":76,"context_line":"    return string.lower()"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_a38a7dbd","line":76,"range":{"start_line":70,"start_character":0,"end_line":76,"end_character":25},"updated":"2016-02-26 17:12:25.000000000","message":"Maybe these can go in common/utils.py since they appear to be very generic.","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f6846b3a07405d133c37f2630ee889221a73cecb","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    )"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"# String conversion to provide case-independence"},{"line_number":71,"context_line":"def convert_to_upper(string):"},{"line_number":72,"context_line":"    return string.upper()"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def convert_to_lower(string):"},{"line_number":76,"context_line":"    return string.lower()"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_f8ed10b8","line":76,"range":{"start_line":70,"start_character":0,"end_line":76,"end_character":25},"in_reply_to":"9aed3d3a_a38a7dbd","updated":"2016-02-29 08:15:31.000000000","message":"Moved","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"edd3f36e3b68447196f32c5e26837ed699627e4d","unresolved":false,"context_lines":[{"line_number":14,"context_line":"\"\"\" Implementation of common functionality \"\"\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def add_admin_state_option(parser, resource, is_create\u003dTrue):"},{"line_number":18,"context_line":"    admin_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":19,"context_line":"    admin_group.add_argument("},{"line_number":20,"context_line":"        \u0027--enable\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_8744611b","line":17,"range":{"start_line":17,"start_character":4,"end_line":17,"end_character":26},"updated":"2016-02-29 09:38:27.000000000","message":"Hi Reedip,\n\nSorry for the late response. I think --list, --enable and --disable could all be put in common/utils.py. And the other options, I don\u0027t think I can tell exactly which should be in common/utils.py, and which should be specific to one module. So let\u0027s put them in each module, and once we found that many other modules also share the same option, we do the refactor again.\n\nBTW, there are lots of different helper functions in utils.py. Can we create a new file named \"utils_option.py\", and put all option helpers in it ?","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c3c7fa71645ad08c5643180fe88775f0cce1f463","unresolved":false,"context_lines":[{"line_number":14,"context_line":"\"\"\" Implementation of common functionality \"\"\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def add_admin_state_option(parser, resource, is_create\u003dTrue):"},{"line_number":18,"context_line":"    admin_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":19,"context_line":"    admin_group.add_argument("},{"line_number":20,"context_line":"        \u0027--enable\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_d541fbaa","line":17,"in_reply_to":"7af24918_c916a954","updated":"2016-03-03 00:27:08.000000000","message":"Hi Akihiro,\n1) For the first point, I think if every CLI is using the same option ( yes my scope is currently limited to the Networking Module) then it can be located at a common place.\n2-3) I agree that the help message is not correct, and can be improved for separate handling of Create and Set","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"45b598d40476664089a3f1a13f2e4dba3126fa7d","unresolved":false,"context_lines":[{"line_number":14,"context_line":"\"\"\" Implementation of common functionality \"\"\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def add_admin_state_option(parser, resource, is_create\u003dTrue):"},{"line_number":18,"context_line":"    admin_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":19,"context_line":"    admin_group.add_argument("},{"line_number":20,"context_line":"        \u0027--enable\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_ec899a27","line":17,"in_reply_to":"7af24918_d541fbaa","updated":"2016-03-03 17:16:41.000000000","message":"I am requesting (strongly) that we maintain a consistent way of handling boolean options in all of OSC.  And that means using two variables in the parser declaration so that we can detect the case of _neither_ option being present (ie, both will be False).  There are places where this matters.  And though either copy-paste or a common function like this, we need to do them the same.\n\nPlease tell me what part of http://docs.openstack.org/developer/python-openstackclient/command-options.html#boolean-options is not clear so I can better explain it.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"0a5e6dd4104af90ea3680084c169ca2bd68546aa","unresolved":false,"context_lines":[{"line_number":14,"context_line":"\"\"\" Implementation of common functionality \"\"\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def add_admin_state_option(parser, resource, is_create\u003dTrue):"},{"line_number":18,"context_line":"    admin_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":19,"context_line":"    admin_group.add_argument("},{"line_number":20,"context_line":"        \u0027--enable\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_8b443ab7","line":17,"in_reply_to":"9aed3d3a_50f77f8a","updated":"2016-02-29 23:54:14.000000000","message":"@Dean : \nYes, that can be done.\nBut for Networking CLI migration, I could not find admin_state having any other option except enable and disable.\nIf there are such options for admin_state which do not follow the below behavior, I would be glad to change these.\n\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nDefault Behavior during Create:\n\n --enable: True\n\nDefault Behavior during Update:\n\n --enable: False\n\n--disable does not need a default value\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"c3354ede38e49e91d69cd878920a515691d69f5c","unresolved":false,"context_lines":[{"line_number":14,"context_line":"\"\"\" Implementation of common functionality \"\"\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def add_admin_state_option(parser, resource, is_create\u003dTrue):"},{"line_number":18,"context_line":"    admin_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":19,"context_line":"    admin_group.add_argument("},{"line_number":20,"context_line":"        \u0027--enable\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_50f77f8a","line":17,"in_reply_to":"9aed3d3a_8744611b","updated":"2016-02-29 23:29:08.000000000","message":"Please do not go and try to put all common argparse definitions into common files.\n\nIt is really not needed.\n\nAlso, this set of enable/disable is wrong.  If you must do this at least use the correct form as documented that uses two independant boolean options.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"45b8fe2c25871f9ab082d4152dc1b92266a87905","unresolved":false,"context_lines":[{"line_number":14,"context_line":"\"\"\" Implementation of common functionality \"\"\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def add_admin_state_option(parser, resource, is_create\u003dTrue):"},{"line_number":18,"context_line":"    admin_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":19,"context_line":"    admin_group.add_argument("},{"line_number":20,"context_line":"        \u0027--enable\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_c916a954","line":17,"in_reply_to":"9aed3d3a_8b443ab7","updated":"2016-03-03 00:07:57.000000000","message":"First, \"[ --enable | --disable ]\" is commonly used in OSC, so I don\u0027t think it is a good idea to have a specific method for network \u0027admin-state\u0027. \n\nSecond, I think Dean suggests separate option definitions for create and set.\n\nThird, the help message is not correct.\nWe don\u0027t have any default when xxx-set.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"45b8fe2c25871f9ab082d4152dc1b92266a87905","unresolved":false,"context_lines":[{"line_number":20,"context_line":"        \u0027--enable\u0027,"},{"line_number":21,"context_line":"        dest\u003d\u0027admin_state\u0027,"},{"line_number":22,"context_line":"        action\u003d\u0027store_true\u0027,"},{"line_number":23,"context_line":"        default\u003dNone if not is_create else is_create,"},{"line_number":24,"context_line":"        help\u003d(\u0027Enable %s (default)\u0027 % resource),"},{"line_number":25,"context_line":"    )"},{"line_number":26,"context_line":"    admin_group.add_argument("}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_80c0f6e1","line":23,"range":{"start_line":23,"start_character":8,"end_line":23,"end_character":53},"updated":"2016-03-03 00:07:57.000000000","message":"Why is this needed? Why doesn\u0027t \u0027None\u0027 work?\n\nThere is no need to pass True when \u0027xxx create\u0027\nif admin_state True is the default value in the server side.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"45b598d40476664089a3f1a13f2e4dba3126fa7d","unresolved":false,"context_lines":[{"line_number":20,"context_line":"        \u0027--enable\u0027,"},{"line_number":21,"context_line":"        dest\u003d\u0027admin_state\u0027,"},{"line_number":22,"context_line":"        action\u003d\u0027store_true\u0027,"},{"line_number":23,"context_line":"        default\u003dNone if not is_create else is_create,"},{"line_number":24,"context_line":"        help\u003d(\u0027Enable %s (default)\u0027 % resource),"},{"line_number":25,"context_line":"    )"},{"line_number":26,"context_line":"    admin_group.add_argument("}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_cce3fed7","line":23,"in_reply_to":"7af24918_80c0f6e1","updated":"2016-03-03 17:16:41.000000000","message":"This is trying to solve the same problem that I addressed by using two simple boolean options and not needing to know the previous value of the option, which is not always available without a round trip to the server.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"c3354ede38e49e91d69cd878920a515691d69f5c","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def add_share_option(parser, resource):"},{"line_number":35,"context_line":"    share_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":36,"context_line":"    share_group.add_argument("},{"line_number":37,"context_line":"        \u0027--share\u0027,"},{"line_number":38,"context_line":"        dest\u003d\u0027shared\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_3033db63","line":35,"updated":"2016-02-29 23:29:08.000000000","message":"Same problem nere with trying to use a sinlge variable dest.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"45b598d40476664089a3f1a13f2e4dba3126fa7d","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def add_share_option(parser, resource):"},{"line_number":35,"context_line":"    share_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":36,"context_line":"    share_group.add_argument("},{"line_number":37,"context_line":"        \u0027--share\u0027,"},{"line_number":38,"context_line":"        dest\u003d\u0027shared\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_96a58748","line":35,"in_reply_to":"7af24918_55620b3f","updated":"2016-03-03 17:16:41.000000000","message":"A boolean option has 3 states: True, False and \u0027not present\u0027, aka None.  There are places where this matters, most often with API calls that only want an attribute included if it is changed.\n\nRe the whole idea of needing these little functions that really don\u0027t add much:\n\nWe deal with 5 different client libraries here, none of which might do the same sort of thing the same way, even within the same library.  For this reason, among others, we generally do not normalize these parser calls, although some have been done in Identity that truly are common and identical, and unique to Identity.\n\nPersonally I do not like having to bounce around in files/modules looking for function implementations when troubleshooting these things.  As I\u0027ve said elsewhere, spending an afternoon with neutronclient convinced me that we made the right choice 4 years ago.","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c3c7fa71645ad08c5643180fe88775f0cce1f463","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def add_share_option(parser, resource):"},{"line_number":35,"context_line":"    share_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":36,"context_line":"    share_group.add_argument("},{"line_number":37,"context_line":"        \u0027--share\u0027,"},{"line_number":38,"context_line":"        dest\u003d\u0027shared\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_55620b3f","line":35,"in_reply_to":"7af24918_b4c8d423","updated":"2016-03-03 00:27:08.000000000","message":"Would like to discuss this further on the IRC","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"0a5e6dd4104af90ea3680084c169ca2bd68546aa","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def add_share_option(parser, resource):"},{"line_number":35,"context_line":"    share_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":36,"context_line":"    share_group.add_argument("},{"line_number":37,"context_line":"        \u0027--share\u0027,"},{"line_number":38,"context_line":"        dest\u003d\u0027shared\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_abfade40","line":35,"in_reply_to":"9aed3d3a_3033db63","updated":"2016-02-29 23:54:14.000000000","message":"@Dean:\nThis is a mutually exclusive group, so only one option can be provided.\nCould you please elucidate a bit more regarding why we cannot use this option?","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"45b8fe2c25871f9ab082d4152dc1b92266a87905","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def add_share_option(parser, resource):"},{"line_number":35,"context_line":"    share_group \u003d parser.add_mutually_exclusive_group()"},{"line_number":36,"context_line":"    share_group.add_argument("},{"line_number":37,"context_line":"        \u0027--share\u0027,"},{"line_number":38,"context_line":"        dest\u003d\u0027shared\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_b4c8d423","line":35,"in_reply_to":"9aed3d3a_abfade40","updated":"2016-03-03 00:07:57.000000000","message":"We have many existing examples. you should follow the convention.\nFor example, https://github.com/openstack/python-openstackclient/blob/master/openstackclient/identity/v3/service.py","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"edd3f36e3b68447196f32c5e26837ed699627e4d","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    )"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def format_admin_state(item):"},{"line_number":62,"context_line":"    return \u0027UP\u0027 if item else \u0027DOWN\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_2702b5b4","line":61,"range":{"start_line":61,"start_character":4,"end_line":61,"end_character":22},"updated":"2016-02-29 09:38:27.000000000","message":"ditto here, can we create a file named \"utils_formater.py\" and put all formaters in it ?\n\nJust my advice. :)","commit_id":"04f685992b730204b9ae21323a8195e046b9e9d9"}],"openstackclient/network/v2/network.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"1025ed13f786da8a1db18a316b37ad7445dd28d9","unresolved":false,"context_lines":[{"line_number":79,"context_line":"class CreateNetwork(command.ShowOne):"},{"line_number":80,"context_line":"    \"\"\"Create new network\"\"\""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    admin_state_attr \u003d {\u0027resource\u0027: \u0027network\u0027, \u0027default_enable\u0027: True}"},{"line_number":83,"context_line":"    shared_attr \u003d {\u0027resource\u0027: \u0027network\u0027}"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_parser(self, prog_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bae84128_9eaff82a","line":82,"range":{"start_line":82,"start_character":47,"end_line":82,"end_character":69},"updated":"2016-02-25 05:46:03.000000000","message":"i think you can assume this in the utility function, i doubt it\u0027ll ever be False","commit_id":"4a1536cd72035ccdd9a348f5d138b93cc33bb497"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"8429a3bc403cf2a3148ce2428dc0911c17abe20c","unresolved":false,"context_lines":[{"line_number":79,"context_line":"class CreateNetwork(command.ShowOne):"},{"line_number":80,"context_line":"    \"\"\"Create new network\"\"\""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    admin_state_attr \u003d {\u0027resource\u0027: \u0027network\u0027, \u0027default_enable\u0027: True}"},{"line_number":83,"context_line":"    shared_attr \u003d {\u0027resource\u0027: \u0027network\u0027}"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_parser(self, prog_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aed3d3a_f651f363","line":82,"range":{"start_line":82,"start_character":47,"end_line":82,"end_character":69},"in_reply_to":"9aed3d3a_36535be3","updated":"2016-02-26 12:48:29.000000000","message":"Yes, sure... evidently I will be waiting for it.","commit_id":"4a1536cd72035ccdd9a348f5d138b93cc33bb497"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"ac5919ee432dc054b790374dee485236bccf8b67","unresolved":false,"context_lines":[{"line_number":79,"context_line":"class CreateNetwork(command.ShowOne):"},{"line_number":80,"context_line":"    \"\"\"Create new network\"\"\""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    admin_state_attr \u003d {\u0027resource\u0027: \u0027network\u0027, \u0027default_enable\u0027: True}"},{"line_number":83,"context_line":"    shared_attr \u003d {\u0027resource\u0027: \u0027network\u0027}"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_parser(self, prog_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aed3d3a_36535be3","line":82,"range":{"start_line":82,"start_character":47,"end_line":82,"end_character":69},"in_reply_to":"9aed3d3a_ab7e07ac","updated":"2016-02-26 12:41:45.000000000","message":"Hi Reedip,\n\nI\u0027ll check other commands and options for this, and try my best to give a list containing which options can be put into common utility functions. Maybe next Mondy. :)","commit_id":"4a1536cd72035ccdd9a348f5d138b93cc33bb497"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e533a0b2f65a7fd21bce9fc10c0c6cfbea055088","unresolved":false,"context_lines":[{"line_number":79,"context_line":"class CreateNetwork(command.ShowOne):"},{"line_number":80,"context_line":"    \"\"\"Create new network\"\"\""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    admin_state_attr \u003d {\u0027resource\u0027: \u0027network\u0027, \u0027default_enable\u0027: True}"},{"line_number":83,"context_line":"    shared_attr \u003d {\u0027resource\u0027: \u0027network\u0027}"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def get_parser(self, prog_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aed3d3a_ab7e07ac","line":82,"range":{"start_line":82,"start_character":47,"end_line":82,"end_character":69},"in_reply_to":"bae84128_9eaff82a","updated":"2016-02-26 00:30:47.000000000","message":"I can do one thing, instead of the complicated default_enable, I will send a Boolean\n\n  True \u003d Create\n  False  \u003d Update\n\nAssuming that we are keeping the behavior same throughout the Neutron CLIs, there should not be a problem.\n\n@Tang: I agree that such common functions should not be limited to Network, but exposed to other sub-projects as well, but I am not sure about their working yet. I think the core can judge it better and let me know what can be moved to the common utility , and what can be kept specifically for Network.\nOtherwise, I think from Network perspective, this should also work.","commit_id":"4a1536cd72035ccdd9a348f5d138b93cc33bb497"},{"author":{"_account_id":18658,"name":"Jas Singh","email":"singhj@us.ibm.com","username":"singhj"},"change_message_id":"666fc25d1d9c097099eaeb97af6cdb5fb15f05b2","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from openstackclient.network import utils as net_utils"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def _format_admin_state(item):"},{"line_number":25,"context_line":"    return \u0027UP\u0027 if item else \u0027DOWN\u0027"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def _format_router_external(item):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_6345156f","line":25,"range":{"start_line":24,"start_character":0,"end_line":25,"end_character":35},"updated":"2016-02-26 17:12:25.000000000","message":"I\u0027ve also been wanting to move this out to a common file. What do you think?","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1613d08aeb601b585397b66512e241e86cdc8482","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from openstackclient.network import utils as net_utils"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def _format_admin_state(item):"},{"line_number":25,"context_line":"    return \u0027UP\u0027 if item else \u0027DOWN\u0027"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def _format_router_external(item):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_67104fa9","line":25,"range":{"start_line":24,"start_character":0,"end_line":25,"end_character":35},"in_reply_to":"9aed3d3a_6345156f","updated":"2016-02-28 16:45:00.000000000","message":"+1","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f6846b3a07405d133c37f2630ee889221a73cecb","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from openstackclient.network import utils as net_utils"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def _format_admin_state(item):"},{"line_number":25,"context_line":"    return \u0027UP\u0027 if item else \u0027DOWN\u0027"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def _format_router_external(item):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_b83ee825","line":25,"range":{"start_line":24,"start_character":0,"end_line":25,"end_character":35},"in_reply_to":"9aed3d3a_6345156f","updated":"2016-02-29 08:15:31.000000000","message":"Okay, moving it to the network/utils.py","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"},{"author":{"_account_id":18658,"name":"Jas Singh","email":"singhj@us.ibm.com","username":"singhj"},"change_message_id":"666fc25d1d9c097099eaeb97af6cdb5fb15f05b2","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    \"\"\"Create new network\"\"\""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_parser(self, prog_name):"},{"line_number":83,"context_line":"        resource \u003d \u0027network\u0027"},{"line_number":84,"context_line":"        parser \u003d super(CreateNetwork, self).get_parser(prog_name)"},{"line_number":85,"context_line":"        parser.add_argument("},{"line_number":86,"context_line":"            \u0027name\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_d9a04ea2","line":83,"range":{"start_line":83,"start_character":7,"end_line":83,"end_character":28},"updated":"2016-02-26 17:12:25.000000000","message":"Maybe moving \u0027resource\u0027 outside of the class. It should be pretty much the same resource throughout the file.","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1613d08aeb601b585397b66512e241e86cdc8482","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    \"\"\"Create new network\"\"\""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_parser(self, prog_name):"},{"line_number":83,"context_line":"        resource \u003d \u0027network\u0027"},{"line_number":84,"context_line":"        parser \u003d super(CreateNetwork, self).get_parser(prog_name)"},{"line_number":85,"context_line":"        parser.add_argument("},{"line_number":86,"context_line":"            \u0027name\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aed3d3a_a72257ff","line":83,"range":{"start_line":83,"start_character":7,"end_line":83,"end_character":28},"in_reply_to":"9aed3d3a_d9a04ea2","updated":"2016-02-28 16:45:00.000000000","message":"In OSC, python module is usually prepared per resource.\nI think it is a good idea to define a resource name as a module level variable.","commit_id":"d31a833121e1ee60c80adb779a1e3087647e499d"}]}
