)]}'
{"novaclient/tests/functional/v2/legacy/test_servers.py":[{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"29d4e3ba34e1b7fe1712c50c47947b708926ff8f","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        self.client.servers.delete(server_id)"},{"line_number":69,"context_line":"        self.wait_for_resource_delete(server_id, self.client.servers)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"class TestServersListNovaClient(base.ClientTestBase):"},{"line_number":73,"context_line":"    \"\"\"Servers list functional tests.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_24f16f6b","line":70,"updated":"2016-01-25 17:23:12.000000000","message":"should I add other functional tests or that unit ones are ok?","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d02f106804da962cbd50bb3d02059ee6ef110117","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        self.client.servers.delete(server_id)"},{"line_number":69,"context_line":"        self.wait_for_resource_delete(server_id, self.client.servers)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"class TestServersListNovaClient(base.ClientTestBase):"},{"line_number":73,"context_line":"    \"\"\"Servers list functional tests.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_ba1ed409","line":70,"in_reply_to":"9a68dd71_24f16f6b","updated":"2016-01-25 17:51:54.000000000","message":"Functional tests are one of my weak areas, but I personally am happy with the unit tests you\u0027ve provided, so I\u0027d say this is fine…","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"}],"novaclient/tests/unit/v2/test_shell.py":[{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"4e3f31a86b6fe00ccb4034bd1a6e8c3370df8774","unresolved":false,"context_lines":[{"line_number":571,"context_line":"               \u0027--nic net-id\u003da\u003dc,v6-fixed-ip\u003d10.0.0.1 some-server\u0027)"},{"line_number":572,"context_line":"        self.assertRaises(exceptions.CommandError, self.run_command, cmd)"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    @mock.patch(\u0027novaclient.v2.shell._find_network_id\u0027, return_value\u003d\u0027some-id\u0027)"},{"line_number":575,"context_line":"    def test_boot_nics_net_name(self, mock_find_network_id):"},{"line_number":576,"context_line":"        cmd \u003d (\u0027boot --image 1 --flavor 1 \u0027"},{"line_number":577,"context_line":"               \u0027--nic net-name\u003dsome-net some-server\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_9a3c0c31","line":574,"range":{"start_line":574,"start_character":4,"end_line":574,"end_character":79},"updated":"2016-01-20 15:44:52.000000000","message":"here we can also don\u0027t make mock and use some specific net-create or use fake default network","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"cea479a09a696cefcac1e191529c05e607ceb1c0","unresolved":false,"context_lines":[{"line_number":597,"context_line":"               \u0027--nic net-name\u003dsome-net some-server\u0027)"},{"line_number":598,"context_line":"        self.assertRaises(exceptions.ResourceNotFound, self.run_command, cmd)"},{"line_number":599,"context_line":""},{"line_number":600,"context_line":"    @mock.patch("},{"line_number":601,"context_line":"        \u0027novaclient.tests.unit.v2.fakes.FakeHTTPClient.get_os_tenant_networks\u0027)"},{"line_number":602,"context_line":"    def test_boot_nics_net_name_multiple_matches(self, mock_tenant_net_list):"},{"line_number":603,"context_line":"        mock_tenant_net_list.return_value \u003d (200, {}, {"},{"line_number":604,"context_line":"            \u0027networks\u0027: [{\"label\": \"some-net\", \u0027id\u0027: \u00271\u0027},"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_ad2449af","line":601,"range":{"start_line":600,"start_character":3,"end_line":601,"end_character":79},"updated":"2016-01-20 12:27:48.000000000","message":"It looks not beautiful, but other simple attempts to create this test don\u0027t work. \n\n1) Mock of \u0027novaclient.v2.contrib.tenant_networks.TenantNetworkManager.list\u0027 didn\u0027t help\n\n2) Code like \u0027f \u003d self.cs.networks.create(label\u003d\u0027foo\u0027)\u0027 needs some init from \u0027class FixturedTestCase\u0027.\n\nDecided to mock Fake method for now, maybe it is ok? Any advice?","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"29d4e3ba34e1b7fe1712c50c47947b708926ff8f","unresolved":false,"context_lines":[{"line_number":572,"context_line":"        self.assertRaises(exceptions.CommandError, self.run_command, cmd)"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    @mock.patch("},{"line_number":575,"context_line":"        \u0027novaclient.tests.unit.v2.fakes.FakeHTTPClient.get_os_networks\u0027)"},{"line_number":576,"context_line":"    def test_boot_nics_net_name(self, mock_networks_list):"},{"line_number":577,"context_line":"        mock_networks_list.return_value \u003d (200, {}, {"},{"line_number":578,"context_line":"            \u0027networks\u0027: [{\"label\": \"some-net\", \u0027id\u0027: \u00271\u0027}]})"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_44cd832f","line":575,"range":{"start_line":575,"start_character":8,"end_line":575,"end_character":71},"updated":"2016-01-25 17:23:12.000000000","message":"Is it ok to mock fakes, any advice?","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d02f106804da962cbd50bb3d02059ee6ef110117","unresolved":false,"context_lines":[{"line_number":572,"context_line":"        self.assertRaises(exceptions.CommandError, self.run_command, cmd)"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    @mock.patch("},{"line_number":575,"context_line":"        \u0027novaclient.tests.unit.v2.fakes.FakeHTTPClient.get_os_networks\u0027)"},{"line_number":576,"context_line":"    def test_boot_nics_net_name(self, mock_networks_list):"},{"line_number":577,"context_line":"        mock_networks_list.return_value \u003d (200, {}, {"},{"line_number":578,"context_line":"            \u0027networks\u0027: [{\"label\": \"some-net\", \u0027id\u0027: \u00271\u0027}]})"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_fab52cec","line":575,"range":{"start_line":575,"start_character":8,"end_line":575,"end_character":71},"in_reply_to":"9a68dd71_44cd832f","updated":"2016-01-25 17:51:54.000000000","message":"I agree with you that it\u0027s kinda ugly, but I suppose it\u0027s acceptable for this case.  The only comment I might make here is that you can put the return_value in the decorator instead of as the first line of your test method, but that\u0027s purely a matter of preference, and I\u0027ve done both ways, personally…","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"}],"novaclient/v2/shell.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e837de0e0a703701e5b4c4c33d24f7338a290aa6","unresolved":false,"context_lines":[{"line_number":28,"context_line":"import sys"},{"line_number":29,"context_line":"import time"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"from oslo.utils import encodeutils"},{"line_number":32,"context_line":"from oslo.utils import strutils"},{"line_number":33,"context_line":"from oslo.utils import timeutils"},{"line_number":34,"context_line":"import six"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_1ec32d3a","line":31,"updated":"2015-09-18 21:12:57.000000000","message":"This would revert some important recent changes to novaclient.  I suspect you have a bad rebase; you need to take a closer look and clean this up.","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":17043,"name":"Timothy Symanczyk","email":"tim@symanczyk.com","username":"timothy_symanczyk"},"change_message_id":"ca514f79aa8b54fde30d67de46acfe961981f4c5","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"from oslo.utils import encodeutils"},{"line_number":32,"context_line":"from oslo.utils import strutils"},{"line_number":33,"context_line":"from oslo.utils import timeutils"},{"line_number":34,"context_line":"import six"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"from novaclient import client"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_3e72b14a","line":33,"updated":"2015-09-18 21:06:48.000000000","message":"Are these changes appropriate?","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e837de0e0a703701e5b4c4c33d24f7338a290aa6","unresolved":false,"context_lines":[{"line_number":265,"context_line":"                raise exceptions.CommandError(err_msg)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"            if k in nic_info:"},{"line_number":268,"context_line":"\t\t#if user has given a name resolve it to network ID"},{"line_number":269,"context_line":"\t        if k \u003d\u003d \u0027net-name\u0027:"},{"line_number":270,"context_line":"\t\t    net_id \u003d _find_netId(cs,v)"},{"line_number":271,"context_line":"                    if net_id :"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_1eda4d18","line":268,"updated":"2015-09-18 21:12:57.000000000","message":"This appears to be your actual code; however, you have tabs in place of spaces, which is a BadIdea(TM) in Python.  Additionally, the comment style we enforce is to have a space between the \u0027#\u0027 and the first character of the comment.","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"c3ad0b2361c9dc9f8e5260f0ee21b1a60430a4a4","unresolved":false,"context_lines":[{"line_number":272,"context_line":"\t\t\tnic_info[\u0027net-id\u0027] \u003d net_id"},{"line_number":273,"context_line":"\t\telse:"},{"line_number":274,"context_line":"                    nic_info[k] \u003d v"},{"line_number":275,"context_line":"            else:"},{"line_number":276,"context_line":"                raise exceptions.CommandError(err_msg)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        if bool(nic_info[\u0027net-id\u0027]) \u003d\u003d bool(nic_info[\u0027port-id\u0027]):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_fe15199b","line":275,"updated":"2015-09-18 21:13:20.000000000","message":"use spaces instead of tabs","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"c3ad0b2361c9dc9f8e5260f0ee21b1a60430a4a4","unresolved":false,"context_lines":[{"line_number":933,"context_line":"@cliutils.arg("},{"line_number":934,"context_line":"    \u0027network\u0027,"},{"line_number":935,"context_line":"    metavar\u003d\u0027\u003cnetwork\u003e\u0027,"},{"line_number":936,"context_line":"    help\u003d\"uuid of network\")"},{"line_number":937,"context_line":"def do_network_associate_project(cs, args):"},{"line_number":938,"context_line":"    \"\"\"Associate project with network.\"\"\""},{"line_number":939,"context_line":"    cs.networks.associate_project(args.network)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_de77f506","line":936,"updated":"2015-09-18 21:13:20.000000000","message":"why did you remove _()?","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"c3ad0b2361c9dc9f8e5260f0ee21b1a60430a4a4","unresolved":false,"context_lines":[{"line_number":1011,"context_line":"@cliutils.arg("},{"line_number":1012,"context_line":"    \u0027--dns1\u0027,"},{"line_number":1013,"context_line":"    dest\u003d\"dns1\","},{"line_number":1014,"context_line":"    metavar\u003d\"\u003cDNS Address\u003e\", help\u003d\u0027First DNS\u0027)"},{"line_number":1015,"context_line":"@cliutils.arg("},{"line_number":1016,"context_line":"    \u0027--dns2\u0027,"},{"line_number":1017,"context_line":"    dest\u003d\"dns2\","}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_be86c1d9","line":1014,"updated":"2015-09-18 21:13:20.000000000","message":"why did you remove _()?","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"c3ad0b2361c9dc9f8e5260f0ee21b1a60430a4a4","unresolved":false,"context_lines":[{"line_number":1302,"context_line":"    dest\u003d\u0027deleted\u0027,"},{"line_number":1303,"context_line":"    action\u003d\"store_true\","},{"line_number":1304,"context_line":"    default\u003dFalse,"},{"line_number":1305,"context_line":"    help\u003d\u0027Only display deleted servers (Admin only).\u0027)"},{"line_number":1306,"context_line":"@cliutils.arg("},{"line_number":1307,"context_line":"    \u0027--fields\u0027,"},{"line_number":1308,"context_line":"    default\u003dNone,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_7e690925","line":1305,"updated":"2015-09-18 21:13:20.000000000","message":"why did you remove _()?","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"c3ad0b2361c9dc9f8e5260f0ee21b1a60430a4a4","unresolved":false,"context_lines":[{"line_number":1466,"context_line":"    \u0027--preserve-ephemeral\u0027,"},{"line_number":1467,"context_line":"    action\u003d\"store_true\","},{"line_number":1468,"context_line":"    default\u003dFalse,"},{"line_number":1469,"context_line":"    help\u003d\u0027Preserve the default ephemeral storage partition on rebuild.\u0027)"},{"line_number":1470,"context_line":"@cliutils.arg("},{"line_number":1471,"context_line":"    \u0027--name\u0027,"},{"line_number":1472,"context_line":"    metavar\u003d\u0027\u003cname\u003e\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_de5e1579","line":1469,"updated":"2015-09-18 21:13:20.000000000","message":"why did you remove _()?","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e837de0e0a703701e5b4c4c33d24f7338a290aa6","unresolved":false,"context_lines":[{"line_number":1918,"context_line":"    except exceptions.NotFound:"},{"line_number":1919,"context_line":"        return cs.flavors.find(ram\u003dflavor)"},{"line_number":1920,"context_line":""},{"line_number":1921,"context_line":"def _find_netId(cs,netName):"},{"line_number":1922,"context_line":"    \"\"\"Get unique network ID from name.\"\"\""},{"line_number":1923,"context_line":"    match_found \u003d False"},{"line_number":1924,"context_line":"    netList \u003d cs.tenant_networks.list()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_fe2e79f9","line":1921,"updated":"2015-09-18 21:12:57.000000000","message":"Have you read PEP8?  That requires two blank lines before any top-level function or class definition like this.","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e837de0e0a703701e5b4c4c33d24f7338a290aa6","unresolved":false,"context_lines":[{"line_number":1921,"context_line":"def _find_netId(cs,netName):"},{"line_number":1922,"context_line":"    \"\"\"Get unique network ID from name.\"\"\""},{"line_number":1923,"context_line":"    match_found \u003d False"},{"line_number":1924,"context_line":"    netList \u003d cs.tenant_networks.list()"},{"line_number":1925,"context_line":"    for netInfo in netList:"},{"line_number":1926,"context_line":"\tencoding \u003d ( locale.getpreferredencoding() or sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":1927,"context_line":"\tif not six.PY3:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_9e0add78","line":1924,"updated":"2015-09-18 21:12:57.000000000","message":"Preferred variable style in novaclient is snake case for variable names, e.g. \"net_list\" as opposed to \"netList\".","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e837de0e0a703701e5b4c4c33d24f7338a290aa6","unresolved":false,"context_lines":[{"line_number":1923,"context_line":"    match_found \u003d False"},{"line_number":1924,"context_line":"    netList \u003d cs.tenant_networks.list()"},{"line_number":1925,"context_line":"    for netInfo in netList:"},{"line_number":1926,"context_line":"\tencoding \u003d ( locale.getpreferredencoding() or sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":1927,"context_line":"\tif not six.PY3:"},{"line_number":1928,"context_line":"\t    netInfo.label \u003d netInfo.label.encode(encoding)"},{"line_number":1929,"context_line":"\tif netName \u003d\u003d netInfo.label:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_de1055ae","line":1926,"updated":"2015-09-18 21:12:57.000000000","message":"Again, you have tabs for your indentation.  Further, the space after the open parenthesis is incorrect style, and you may have a code line here longer than the limit of 79 columns.","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e837de0e0a703701e5b4c4c33d24f7338a290aa6","unresolved":false,"context_lines":[{"line_number":1937,"context_line":"\traise exceptions.CommandError(_(\"network ID or name \u0027%s\u0027 not found.\")"},{"line_number":1938,"context_line":"\t\t\t\t      % netName)"},{"line_number":1939,"context_line":"    return match_found"},{"line_number":1940,"context_line":"    "},{"line_number":1941,"context_line":"@cliutils.arg(\u0027server\u0027, metavar\u003d\u0027\u003cserver\u003e\u0027, help\u003d_(\u0027Name or ID of server.\u0027))"},{"line_number":1942,"context_line":"@cliutils.arg("},{"line_number":1943,"context_line":"    \u0027network_id\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_fe7c39ed","line":1940,"updated":"2015-09-18 21:12:57.000000000","message":"There\u0027s trailing whitespace here.  Further, you need to include another blank line to properly set this off from the definition of do_add_fixed_ip() below.","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"c3ad0b2361c9dc9f8e5260f0ee21b1a60430a4a4","unresolved":false,"context_lines":[{"line_number":1937,"context_line":"\traise exceptions.CommandError(_(\"network ID or name \u0027%s\u0027 not found.\")"},{"line_number":1938,"context_line":"\t\t\t\t      % netName)"},{"line_number":1939,"context_line":"    return match_found"},{"line_number":1940,"context_line":"    "},{"line_number":1941,"context_line":"@cliutils.arg(\u0027server\u0027, metavar\u003d\u0027\u003cserver\u003e\u0027, help\u003d_(\u0027Name or ID of server.\u0027))"},{"line_number":1942,"context_line":"@cliutils.arg("},{"line_number":1943,"context_line":"    \u0027network_id\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_9e589d8c","line":1940,"updated":"2015-09-18 21:13:20.000000000","message":"replace tabs with spaces.. Remove white space on empty line.","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"c3ad0b2361c9dc9f8e5260f0ee21b1a60430a4a4","unresolved":false,"context_lines":[{"line_number":3551,"context_line":"    utils.print_list(result, columns)"},{"line_number":3552,"context_line":""},{"line_number":3553,"context_line":""},{"line_number":3554,"context_line":"@cliutils.arg(\u0027host\u0027, metavar\u003d\u0027\u003chostname\u003e\u0027, help\u003d\u0027Name of host.\u0027)"},{"line_number":3555,"context_line":"@cliutils.arg("},{"line_number":3556,"context_line":"    \u0027--status\u0027, metavar\u003d\u0027\u003cenable|disable\u003e\u0027, default\u003dNone, dest\u003d\u0027status\u0027,"},{"line_number":3557,"context_line":"    help\u003d_(\u0027Either enable or disable a host.\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_3e4ab1ad","line":3554,"updated":"2015-09-18 21:13:20.000000000","message":"why did you remove _()?","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"c3ad0b2361c9dc9f8e5260f0ee21b1a60430a4a4","unresolved":false,"context_lines":[{"line_number":4411,"context_line":"    raise exceptions.CommandError(_(\"Rule not found\"))"},{"line_number":4412,"context_line":""},{"line_number":4413,"context_line":""},{"line_number":4414,"context_line":"@cliutils.arg(\u0027name\u0027, metavar\u003d\u0027\u003cname\u003e\u0027, help\u003d\u0027Server group name.\u0027)"},{"line_number":4415,"context_line":"# NOTE(wingwj): The \u0027--policy\u0027 way is still reserved here for preserving"},{"line_number":4416,"context_line":"# the backwards compatibility of CLI, even if a user won\u0027t get this usage"},{"line_number":4417,"context_line":"# in \u0027--help\u0027 description. It will be deprecated after an suitable deprecation"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_fecaf919","line":4414,"updated":"2015-09-18 21:13:20.000000000","message":"why did you remove _()?","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"c3ad0b2361c9dc9f8e5260f0ee21b1a60430a4a4","unresolved":false,"context_lines":[{"line_number":4427,"context_line":"    metavar\u003d\u0027\u003cpolicy\u003e\u0027,"},{"line_number":4428,"context_line":"    default\u003dargparse.SUPPRESS,"},{"line_number":4429,"context_line":"    nargs\u003d\u0027*\u0027,"},{"line_number":4430,"context_line":"    help\u003d\u0027Policies for the server groups (\"affinity\" or \"anti-affinity\")\u0027)"},{"line_number":4431,"context_line":"@cliutils.arg("},{"line_number":4432,"context_line":"    \u0027--policy\u0027,"},{"line_number":4433,"context_line":"    default\u003d[],"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_9ecf3d29","line":4430,"updated":"2015-09-18 21:13:20.000000000","message":"why did you remove _()?","commit_id":"25c2ec80a2b3ce33dd99c5eb9a5f51f3ab010912"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"0d8407fef5d2a62597223c80393f1def25d72971","unresolved":false,"context_lines":[{"line_number":1975,"context_line":"        return cs.flavors.find(ram\u003dflavor)"},{"line_number":1976,"context_line":""},{"line_number":1977,"context_line":""},{"line_number":1978,"context_line":"def _find_netId(cs, netName):"},{"line_number":1979,"context_line":"    \"\"\"Get unique network ID from name.\"\"\""},{"line_number":1980,"context_line":"    match_found \u003d None"},{"line_number":1981,"context_line":"    encoding \u003d (locale.getpreferredencoding() or sys.stdin.encoding or \u0027UTF-8\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a2ca52d_fa08782f","line":1978,"updated":"2015-10-14 16:22:12.000000000","message":"Please use snake_case rather than CamelCase for function names, method names, parameter names, and variable names; Python style only uses CamelCase for class names.","commit_id":"149510674c3dd69ab024418a030b30d6401295bd"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"0d8407fef5d2a62597223c80393f1def25d72971","unresolved":false,"context_lines":[{"line_number":1980,"context_line":"    match_found \u003d None"},{"line_number":1981,"context_line":"    encoding \u003d (locale.getpreferredencoding() or sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":1982,"context_line":"    netList \u003d cs.tenant_networks.list()"},{"line_number":1983,"context_line":"    for netInfo in netList:"},{"line_number":1984,"context_line":"        if not six.PY3:"},{"line_number":1985,"context_line":"            netInfo.label \u003d netInfo.label.encode(encoding)"},{"line_number":1986,"context_line":"        if netName \u003d\u003d netInfo.label:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a2ca52d_953597db","line":1983,"updated":"2015-10-14 16:22:12.000000000","message":"Since you don\u0027t use the value of netList (or \"net_list\", as it should be), I\u0027d recommend writing the preceding two lines as:\n\n    for net_info in cs.tenant_networks.list():","commit_id":"149510674c3dd69ab024418a030b30d6401295bd"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"a4720ef043612e180160d62a81cf8a396abdcfe4","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                    nic_info[k] \u003d v"},{"line_number":295,"context_line":"            else:"},{"line_number":296,"context_line":"                raise exceptions.CommandError(err_msg)"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        if nic_info[\u0027v4-fixed-ip\u0027] and not netutils.is_valid_ipv4("},{"line_number":299,"context_line":"                nic_info[\u0027v4-fixed-ip\u0027]):"},{"line_number":300,"context_line":"            raise exceptions.CommandError(_(\"Invalid ipv4 address.\"))"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_e046434e","line":297,"updated":"2016-01-22 13:58:50.000000000","message":"I suppose you should remove net-name from nic_info here and do not transmit it to API side.","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"2ca2d1cf19bfe4d17aea2ad7b1301a4691cb5dd1","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                    nic_info[k] \u003d v"},{"line_number":295,"context_line":"            else:"},{"line_number":296,"context_line":"                raise exceptions.CommandError(err_msg)"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        if nic_info[\u0027v4-fixed-ip\u0027] and not netutils.is_valid_ipv4("},{"line_number":299,"context_line":"                nic_info[\u0027v4-fixed-ip\u0027]):"},{"line_number":300,"context_line":"            raise exceptions.CommandError(_(\"Invalid ipv4 address.\"))"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_80313a5c","line":297,"in_reply_to":"9a68dd71_e046434e","updated":"2016-01-25 13:51:50.000000000","message":"Done","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"a4720ef043612e180160d62a81cf8a396abdcfe4","unresolved":false,"context_lines":[{"line_number":529,"context_line":"    default\u003d[],"},{"line_number":530,"context_line":"    help\u003d_(\"Create a NIC on the server. \""},{"line_number":531,"context_line":"           \"Specify option multiple times to create multiple NICs. \""},{"line_number":532,"context_line":"           \"net-id: attach NIC to network with this UUID \""},{"line_number":533,"context_line":"           \"net-name: attach NIC to network with this name \""},{"line_number":534,"context_line":"           \"(either port-id or net-id or net-name must be provided), \""},{"line_number":535,"context_line":"           \"v4-fixed-ip: IPv4 fixed address for NIC (optional), \""},{"line_number":536,"context_line":"           \"v6-fixed-ip: IPv6 fixed address for NIC (optional), \""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_a054cbfe","line":533,"range":{"start_line":532,"start_character":11,"end_line":533,"end_character":60},"updated":"2016-01-22 13:58:50.000000000","message":"You should check that both parameters are not specified","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"2ca2d1cf19bfe4d17aea2ad7b1301a4691cb5dd1","unresolved":false,"context_lines":[{"line_number":529,"context_line":"    default\u003d[],"},{"line_number":530,"context_line":"    help\u003d_(\"Create a NIC on the server. \""},{"line_number":531,"context_line":"           \"Specify option multiple times to create multiple NICs. \""},{"line_number":532,"context_line":"           \"net-id: attach NIC to network with this UUID \""},{"line_number":533,"context_line":"           \"net-name: attach NIC to network with this name \""},{"line_number":534,"context_line":"           \"(either port-id or net-id or net-name must be provided), \""},{"line_number":535,"context_line":"           \"v4-fixed-ip: IPv4 fixed address for NIC (optional), \""},{"line_number":536,"context_line":"           \"v6-fixed-ip: IPv6 fixed address for NIC (optional), \""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_e04276ad","line":533,"range":{"start_line":532,"start_character":11,"end_line":533,"end_character":60},"in_reply_to":"9a68dd71_a054cbfe","updated":"2016-01-25 13:51:50.000000000","message":"Done","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"3104e19147a25570745ac3e67b12dc259b2066b6","unresolved":false,"context_lines":[{"line_number":2097,"context_line":"def _find_network_id(cs, net_name):"},{"line_number":2098,"context_line":"    \"\"\"Get unique network ID from name.\"\"\""},{"line_number":2099,"context_line":"    network_id \u003d None"},{"line_number":2100,"context_line":"    for net_info in cs.tenant_networks.list():"},{"line_number":2101,"context_line":"        if not six.PY3:"},{"line_number":2102,"context_line":"            encoding \u003d (locale.getpreferredencoding() or"},{"line_number":2103,"context_line":"                        sys.stdin.encoding or \u0027UTF-8\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_14de35dd","line":2100,"range":{"start_line":2100,"start_character":20,"end_line":2100,"end_character":45},"updated":"2016-01-22 15:06:39.000000000","message":"`tenant_networks` is an extension[0], which is not turned on by default, so this line can raise AttributeError with message `\u0027Client\u0027 object has no attribute \u0027tenant_networks\u0027` if user will not enable it by hands. Why not cs.networks.list?\n\n\n[0] - https://github.com/openstack/python-novaclient/blob/3.2.0/novaclient/v2/contrib/tenant_networks.py","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"2ca2d1cf19bfe4d17aea2ad7b1301a4691cb5dd1","unresolved":false,"context_lines":[{"line_number":2097,"context_line":"def _find_network_id(cs, net_name):"},{"line_number":2098,"context_line":"    \"\"\"Get unique network ID from name.\"\"\""},{"line_number":2099,"context_line":"    network_id \u003d None"},{"line_number":2100,"context_line":"    for net_info in cs.tenant_networks.list():"},{"line_number":2101,"context_line":"        if not six.PY3:"},{"line_number":2102,"context_line":"            encoding \u003d (locale.getpreferredencoding() or"},{"line_number":2103,"context_line":"                        sys.stdin.encoding or \u0027UTF-8\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_3301c138","line":2100,"range":{"start_line":2100,"start_character":20,"end_line":2100,"end_character":45},"in_reply_to":"9a68dd71_14de35dd","updated":"2016-01-25 13:51:50.000000000","message":"ok, I\u0027m not sure here, change to \u0027networks\u0027 instead","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"cea479a09a696cefcac1e191529c05e607ceb1c0","unresolved":false,"context_lines":[{"line_number":2098,"context_line":"    \"\"\"Get unique network ID from name.\"\"\""},{"line_number":2099,"context_line":"    network_id \u003d None"},{"line_number":2100,"context_line":"    for net_info in cs.tenant_networks.list():"},{"line_number":2101,"context_line":"        if not six.PY3:"},{"line_number":2102,"context_line":"            encoding \u003d (locale.getpreferredencoding() or"},{"line_number":2103,"context_line":"                        sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":2104,"context_line":"            net_info.label \u003d net_info.label.encode(encoding)"},{"line_number":2105,"context_line":"        if net_name \u003d\u003d net_info.label:"},{"line_number":2106,"context_line":"            if network_id is not None:"},{"line_number":2107,"context_line":"                msg \u003d (_(\"Multiple network name matches found for name \u0027%s\u0027, \""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_4d682dbb","line":2104,"range":{"start_line":2101,"start_character":8,"end_line":2104,"end_character":60},"updated":"2016-01-20 12:27:48.000000000","message":"Don\u0027t know for sure is it needed?","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"3104e19147a25570745ac3e67b12dc259b2066b6","unresolved":false,"context_lines":[{"line_number":2098,"context_line":"    \"\"\"Get unique network ID from name.\"\"\""},{"line_number":2099,"context_line":"    network_id \u003d None"},{"line_number":2100,"context_line":"    for net_info in cs.tenant_networks.list():"},{"line_number":2101,"context_line":"        if not six.PY3:"},{"line_number":2102,"context_line":"            encoding \u003d (locale.getpreferredencoding() or"},{"line_number":2103,"context_line":"                        sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":2104,"context_line":"            net_info.label \u003d net_info.label.encode(encoding)"},{"line_number":2105,"context_line":"        if net_name \u003d\u003d net_info.label:"},{"line_number":2106,"context_line":"            if network_id is not None:"},{"line_number":2107,"context_line":"                msg \u003d (_(\"Multiple network name matches found for name \u0027%s\u0027, \""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_745a112c","line":2104,"range":{"start_line":2101,"start_character":8,"end_line":2104,"end_character":60},"in_reply_to":"9a68dd71_4d682dbb","updated":"2016-01-22 15:06:39.000000000","message":"Let\u0027s add a functional test to check that this code is required.","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"2ca2d1cf19bfe4d17aea2ad7b1301a4691cb5dd1","unresolved":false,"context_lines":[{"line_number":2098,"context_line":"    \"\"\"Get unique network ID from name.\"\"\""},{"line_number":2099,"context_line":"    network_id \u003d None"},{"line_number":2100,"context_line":"    for net_info in cs.tenant_networks.list():"},{"line_number":2101,"context_line":"        if not six.PY3:"},{"line_number":2102,"context_line":"            encoding \u003d (locale.getpreferredencoding() or"},{"line_number":2103,"context_line":"                        sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":2104,"context_line":"            net_info.label \u003d net_info.label.encode(encoding)"},{"line_number":2105,"context_line":"        if net_name \u003d\u003d net_info.label:"},{"line_number":2106,"context_line":"            if network_id is not None:"},{"line_number":2107,"context_line":"                msg \u003d (_(\"Multiple network name matches found for name \u0027%s\u0027, \""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_9363cd41","line":2104,"range":{"start_line":2101,"start_character":8,"end_line":2104,"end_character":60},"in_reply_to":"9a68dd71_745a112c","updated":"2016-01-25 13:51:50.000000000","message":"Added functional test to boot vm by test_name, please look. I\u0027m still not sure in this)","commit_id":"920ddd58746b76c710ca0242401fb627306990aa"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"c089666f8ba9fd0bc996b45d351b0430ed634983","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        err_msg \u003d (_(\"Invalid nic argument \u0027%s\u0027. Nic arguments must be of \""},{"line_number":276,"context_line":"                     \"the form --nic \u003cnet-id\u003dnet-uuid,net-name\u003dnetwork-name,\""},{"line_number":277,"context_line":"                     \"v4-fixed-ip\u003dip-addr,v6-fixed-ip\u003dip-addr,\""},{"line_number":278,"context_line":"                     \"port-id\u003dport-uuid\u003e, with net-id or network-name \""},{"line_number":279,"context_line":"                     \"or port-id specified.\") % nic_str)"},{"line_number":280,"context_line":"        nic_info \u003d {\"net-id\": \"\", \"v4-fixed-ip\": \"\", \"v6-fixed-ip\": \"\","},{"line_number":281,"context_line":"                    \"port-id\": \"\", \"net-name\": \"\"}"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_f0e55208","line":278,"range":{"start_line":278,"start_character":57,"end_line":278,"end_character":69},"updated":"2016-01-25 17:06:06.000000000","message":"s/network-name/net-name/ for consistency…","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"29d4e3ba34e1b7fe1712c50c47947b708926ff8f","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        err_msg \u003d (_(\"Invalid nic argument \u0027%s\u0027. Nic arguments must be of \""},{"line_number":276,"context_line":"                     \"the form --nic \u003cnet-id\u003dnet-uuid,net-name\u003dnetwork-name,\""},{"line_number":277,"context_line":"                     \"v4-fixed-ip\u003dip-addr,v6-fixed-ip\u003dip-addr,\""},{"line_number":278,"context_line":"                     \"port-id\u003dport-uuid\u003e, with net-id or network-name \""},{"line_number":279,"context_line":"                     \"or port-id specified.\") % nic_str)"},{"line_number":280,"context_line":"        nic_info \u003d {\"net-id\": \"\", \"v4-fixed-ip\": \"\", \"v6-fixed-ip\": \"\","},{"line_number":281,"context_line":"                    \"port-id\": \"\", \"net-name\": \"\"}"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_6448c7cc","line":278,"range":{"start_line":278,"start_character":57,"end_line":278,"end_character":69},"in_reply_to":"9a68dd71_f0e55208","updated":"2016-01-25 17:23:12.000000000","message":"Done","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"c089666f8ba9fd0bc996b45d351b0430ed634983","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        # if user has given a net-name pass only network ID to API side"},{"line_number":313,"context_line":"        if network_id:"},{"line_number":314,"context_line":"            nic_info.pop(\u0027net-name\u0027)"},{"line_number":315,"context_line":"            nic_info[\u0027net-id\u0027] \u003d network_id"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"        nics.append(nic_info)"},{"line_number":318,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_d057ee55","line":315,"updated":"2016-01-25 17:06:06.000000000","message":"This logic could be folded into the loop at line 285-297.  In particular, the if clause at line 291 could be preceded by:\n\n    if k \u003d\u003d \u0027net-name\u0027:\n        k \u003d \u0027net-id\u0027\n        v \u003d _find_network_id(cs, v)\n\nNow you can leave the \"net-name\" key out of nic_info and don\u0027t need the extra \"network_id\" variable hanging around…and this \"if network_id\" clause goes away.  For that matter, the \"args_given\" change at line 307 is no longer necessary (which is great, because I\u0027d have other suggestions on how to write *that* :)","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"4eada83351b928d7f6b8f54460999b91df877232","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        # if user has given a net-name pass only network ID to API side"},{"line_number":313,"context_line":"        if network_id:"},{"line_number":314,"context_line":"            nic_info.pop(\u0027net-name\u0027)"},{"line_number":315,"context_line":"            nic_info[\u0027net-id\u0027] \u003d network_id"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"        nics.append(nic_info)"},{"line_number":318,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_3c671b27","line":315,"in_reply_to":"9a68dd71_679209f8","updated":"2016-01-26 12:49:10.000000000","message":"Yes, but I think providing \u0027net-id\u0027 twice is not a big problem comparing with providing both \u0027net-name\u0027 and \u0027net-id\u0027. In this case I want to see some error because the user will don\u0027t know what argument was taken. \n\nI think it is a problem, that\u0027s why I write this code with different \u0027args_given\u0027 variable. So, I decide to leave it as I propose and then maybe add separate patch and fix other problem with providing some argument multiple times.","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d02f106804da962cbd50bb3d02059ee6ef110117","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        # if user has given a net-name pass only network ID to API side"},{"line_number":313,"context_line":"        if network_id:"},{"line_number":314,"context_line":"            nic_info.pop(\u0027net-name\u0027)"},{"line_number":315,"context_line":"            nic_info[\u0027net-id\u0027] \u003d network_id"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"        nics.append(nic_info)"},{"line_number":318,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_679209f8","line":315,"in_reply_to":"9a68dd71_841a9bc4","updated":"2016-01-25 17:51:54.000000000","message":"Ask yourself what happens if the user provides net-id twice with the given code: from my analysis, the last one provided wins.  The same will happen with your logic, even as amended with my suggestions.  I\u0027m content to allow that state of affairs to continue for now, and perhaps a later change could revise the logic to emit at least a warning in that case.  (I suggest that you not do that in this change; I think it\u0027s an unrelated change, and should be in a separate review.)","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"29d4e3ba34e1b7fe1712c50c47947b708926ff8f","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        # if user has given a net-name pass only network ID to API side"},{"line_number":313,"context_line":"        if network_id:"},{"line_number":314,"context_line":"            nic_info.pop(\u0027net-name\u0027)"},{"line_number":315,"context_line":"            nic_info[\u0027net-id\u0027] \u003d network_id"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"        nics.append(nic_info)"},{"line_number":318,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_841a9bc4","line":315,"in_reply_to":"9a68dd71_d057ee55","updated":"2016-01-25 17:23:12.000000000","message":"Understand, but what if a user provides both net-name and net-id? With your suggestion we will not know that it happens and everything will depend on the order of the loop.","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"29d4e3ba34e1b7fe1712c50c47947b708926ff8f","unresolved":false,"context_lines":[{"line_number":2106,"context_line":"    \"\"\"Get unique network ID from network name.\"\"\""},{"line_number":2107,"context_line":"    network_id \u003d None"},{"line_number":2108,"context_line":"    for net_info in cs.networks.list():"},{"line_number":2109,"context_line":"        if not six.PY3:"},{"line_number":2110,"context_line":"            encoding \u003d (locale.getpreferredencoding() or"},{"line_number":2111,"context_line":"                        sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":2112,"context_line":"            net_info.label \u003d net_info.label.encode(encoding)"},{"line_number":2113,"context_line":"        if net_name \u003d\u003d net_info.label:"},{"line_number":2114,"context_line":"            if network_id is not None:"},{"line_number":2115,"context_line":"                msg \u003d (_(\"Multiple network name matches found for name \u0027%s\u0027, \""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_c48733b3","line":2112,"range":{"start_line":2109,"start_character":8,"end_line":2112,"end_character":60},"updated":"2016-01-25 17:23:12.000000000","message":"this was in original patch, is it really needed?","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d02f106804da962cbd50bb3d02059ee6ef110117","unresolved":false,"context_lines":[{"line_number":2106,"context_line":"    \"\"\"Get unique network ID from network name.\"\"\""},{"line_number":2107,"context_line":"    network_id \u003d None"},{"line_number":2108,"context_line":"    for net_info in cs.networks.list():"},{"line_number":2109,"context_line":"        if not six.PY3:"},{"line_number":2110,"context_line":"            encoding \u003d (locale.getpreferredencoding() or"},{"line_number":2111,"context_line":"                        sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":2112,"context_line":"            net_info.label \u003d net_info.label.encode(encoding)"},{"line_number":2113,"context_line":"        if net_name \u003d\u003d net_info.label:"},{"line_number":2114,"context_line":"            if network_id is not None:"},{"line_number":2115,"context_line":"                msg \u003d (_(\"Multiple network name matches found for name \u0027%s\u0027, \""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_fa420c0e","line":2112,"range":{"start_line":2109,"start_character":8,"end_line":2112,"end_character":60},"in_reply_to":"9a68dd71_c48733b3","updated":"2016-01-25 17:51:54.000000000","message":"To be honest, I\u0027m not sure.  This code, on Python 2, would change the data stored in \"net_info.label\" (a \"unicode\" object, obtained by iterating over the results of cs.networks.list()) into a \"str\" object with a local encoding, which will then be compared with the \"net_name\" argument.  Now, \"net_name\" will be a \"str\" from the command line, hopefully using the same encoding as selected here, so my initial impression is that this would indeed be necessary in Python 2 when non-ASCII characters are used in a network name.","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"4eada83351b928d7f6b8f54460999b91df877232","unresolved":false,"context_lines":[{"line_number":2106,"context_line":"    \"\"\"Get unique network ID from network name.\"\"\""},{"line_number":2107,"context_line":"    network_id \u003d None"},{"line_number":2108,"context_line":"    for net_info in cs.networks.list():"},{"line_number":2109,"context_line":"        if not six.PY3:"},{"line_number":2110,"context_line":"            encoding \u003d (locale.getpreferredencoding() or"},{"line_number":2111,"context_line":"                        sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":2112,"context_line":"            net_info.label \u003d net_info.label.encode(encoding)"},{"line_number":2113,"context_line":"        if net_name \u003d\u003d net_info.label:"},{"line_number":2114,"context_line":"            if network_id is not None:"},{"line_number":2115,"context_line":"                msg \u003d (_(\"Multiple network name matches found for name \u0027%s\u0027, \""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_7ceef3b5","line":2112,"range":{"start_line":2109,"start_character":8,"end_line":2112,"end_character":60},"in_reply_to":"9a68dd71_fa420c0e","updated":"2016-01-26 12:49:10.000000000","message":"Ok, will remove it for now. Will think about possible problems here in separate patch. (as Andrey advised in 6-th patchset)","commit_id":"070ae0aed05d93a27960bd0930324398cb89bd13"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"2c6f8b939d5fba47c81d065d244c9fba6f986fc3","unresolved":false,"context_lines":[{"line_number":2106,"context_line":"    \"\"\"Get unique network ID from network name.\"\"\""},{"line_number":2107,"context_line":"    network_id \u003d None"},{"line_number":2108,"context_line":"    for net_info in cs.networks.list():"},{"line_number":2109,"context_line":"        if not six.PY3:"},{"line_number":2110,"context_line":"            encoding \u003d (locale.getpreferredencoding() or"},{"line_number":2111,"context_line":"                        sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":2112,"context_line":"            net_info.label \u003d net_info.label.encode(encoding)"},{"line_number":2113,"context_line":"        if net_name \u003d\u003d net_info.label:"},{"line_number":2114,"context_line":"            if network_id is not None:"},{"line_number":2115,"context_line":"                msg \u003d (_(\"Multiple network name matches found for name \u0027%s\u0027, \""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_3bedefef","line":2112,"range":{"start_line":2109,"start_character":8,"end_line":2112,"end_character":60},"updated":"2016-01-26 08:34:49.000000000","message":"I\u0027m not sure that we need this code, since do_networks_list[*] displays networks without additional encoding/decoding. I\u0027m not saying that do_networks_list doesn\u0027t include bugs, but it would nice to have additional functional tests for non-utf-8 names of networks. Lets move this part of code to separate patch.","commit_id":"08869f824bedee0848ef622ae3291dfdff1584d7"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"ba9aa1ef85beaa124dba3e1d4800c5c5a648ba21","unresolved":false,"context_lines":[{"line_number":2106,"context_line":"    \"\"\"Get unique network ID from network name.\"\"\""},{"line_number":2107,"context_line":"    network_id \u003d None"},{"line_number":2108,"context_line":"    for net_info in cs.networks.list():"},{"line_number":2109,"context_line":"        if not six.PY3:"},{"line_number":2110,"context_line":"            encoding \u003d (locale.getpreferredencoding() or"},{"line_number":2111,"context_line":"                        sys.stdin.encoding or \u0027UTF-8\u0027)"},{"line_number":2112,"context_line":"            net_info.label \u003d net_info.label.encode(encoding)"},{"line_number":2113,"context_line":"        if net_name \u003d\u003d net_info.label:"},{"line_number":2114,"context_line":"            if network_id is not None:"},{"line_number":2115,"context_line":"                msg \u003d (_(\"Multiple network name matches found for name \u0027%s\u0027, \""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_1cdc9717","line":2112,"range":{"start_line":2109,"start_character":8,"end_line":2112,"end_character":60},"in_reply_to":"9a68dd71_3bedefef","updated":"2016-01-26 12:43:26.000000000","message":"Ok, will remove it. Will think about possible problems here in seperate patch","commit_id":"08869f824bedee0848ef622ae3291dfdff1584d7"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"691934fc685eaf83ee61fd935a500e45bc992535","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                nic_info[k] \u003d v"},{"line_number":293,"context_line":"                # if user has given a net-name resolve it to network ID"},{"line_number":294,"context_line":"                if k \u003d\u003d \u0027net-name\u0027:"},{"line_number":295,"context_line":"                    network_id \u003d _find_network_id(cs, v)"},{"line_number":296,"context_line":"            else:"},{"line_number":297,"context_line":"                raise exceptions.CommandError(err_msg)"},{"line_number":298,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_b81f81b6","line":295,"updated":"2016-01-26 18:23:48.000000000","message":"I\u0027m really not quite satisfied with this way of coding this.  I\u0027ll not -1 for this, in case someone disagrees with me, but I really think the simplification I suggested is the way to go.  If you really want to exclude having both set, then I\u0027d suggest using a set to track which keys have been processed and raising a CommandError when someone uses the key twice.  That\u0027d look something like:\n\n    seen \u003d set()\n    for kv_str in nic_str.split(\",\"):\n        try:\n            …\n\n        if k \u003d\u003d \u0027net-name\u0027:\n            k \u003d \u0027net-id\u0027\n            v \u003d _find_network_id(cs, v)\n\n        if k in nic_info:\n            if k in seen:\n                raise exceptions.CommandError(…)\n            seen.add(k)\n\n            nic_info[k] \u003d v\n        else:\n            raise exceptions.CommandError(err_msg)\n\n        …","commit_id":"a890e4bc8450a849ce6ab4dee2bce78c3efb0a70"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"7e865c9a4c61e64c7160068450b0bb937a70c563","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                nic_info[k] \u003d v"},{"line_number":293,"context_line":"                # if user has given a net-name resolve it to network ID"},{"line_number":294,"context_line":"                if k \u003d\u003d \u0027net-name\u0027:"},{"line_number":295,"context_line":"                    network_id \u003d _find_network_id(cs, v)"},{"line_number":296,"context_line":"            else:"},{"line_number":297,"context_line":"                raise exceptions.CommandError(err_msg)"},{"line_number":298,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7a5de9d1_83927156","line":295,"in_reply_to":"9a68dd71_b81f81b6","updated":"2016-01-27 12:57:18.000000000","message":"I also thought about it) Ok, I don\u0027t mind) but I decide even not use to new set variable, please look.\n\nAlso please think about error_messages. Now e.g. if user provides correct \u0027net-name\u0027 and some \u0027net-id\u0027 he will get common error message (\u0027err_msg\u0027). \n\nWill it make sense to user? (I mean that he must provide only one argument exactly once)","commit_id":"a890e4bc8450a849ce6ab4dee2bce78c3efb0a70"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"6f985f086b68ed476f5bd6480e67555909807bf6","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        err_msg \u003d (_(\"Invalid nic argument \u0027%s\u0027. Nic arguments must be of \""},{"line_number":276,"context_line":"                     \"the form --nic \u003cnet-id\u003dnet-uuid,net-name\u003dnetwork-name,\""},{"line_number":277,"context_line":"                     \"v4-fixed-ip\u003dip-addr,v6-fixed-ip\u003dip-addr,\""},{"line_number":278,"context_line":"                     \"port-id\u003dport-uuid\u003e, with net-id or net-name or port-id \""},{"line_number":279,"context_line":"                     \"specified.\") % nic_str)"},{"line_number":280,"context_line":"        nic_info \u003d {\"net-id\": \"\", \"v4-fixed-ip\": \"\", \"v6-fixed-ip\": \"\","},{"line_number":281,"context_line":"                    \"port-id\": \"\", \"net-name\": \"\"}"},{"line_number":282,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7a5de9d1_1b149ef3","line":279,"range":{"start_line":278,"start_character":42,"end_line":279,"end_character":31},"updated":"2016-01-27 16:28:05.000000000","message":"In response to your question about whether this common error message will make sense to the user: this could be reworded as:\n\n    with only one of net-id, net-name, or port-id specified.","commit_id":"8d84aac045a1b66f559e0761677daea303646c59"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"c6f44f680eb8b545172595133bc0b33ea561d8e1","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        err_msg \u003d (_(\"Invalid nic argument \u0027%s\u0027. Nic arguments must be of \""},{"line_number":276,"context_line":"                     \"the form --nic \u003cnet-id\u003dnet-uuid,net-name\u003dnetwork-name,\""},{"line_number":277,"context_line":"                     \"v4-fixed-ip\u003dip-addr,v6-fixed-ip\u003dip-addr,\""},{"line_number":278,"context_line":"                     \"port-id\u003dport-uuid\u003e, with net-id or net-name or port-id \""},{"line_number":279,"context_line":"                     \"specified.\") % nic_str)"},{"line_number":280,"context_line":"        nic_info \u003d {\"net-id\": \"\", \"v4-fixed-ip\": \"\", \"v6-fixed-ip\": \"\","},{"line_number":281,"context_line":"                    \"port-id\": \"\", \"net-name\": \"\"}"},{"line_number":282,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7a5de9d1_10f790d4","line":279,"range":{"start_line":278,"start_character":42,"end_line":279,"end_character":31},"in_reply_to":"7a5de9d1_1b149ef3","updated":"2016-01-27 19:46:14.000000000","message":"hmm, I like it) thanks","commit_id":"8d84aac045a1b66f559e0761677daea303646c59"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"6f985f086b68ed476f5bd6480e67555909807bf6","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                    k \u003d \u0027net-id\u0027"},{"line_number":293,"context_line":"                    v \u003d _find_network_id(cs, v)"},{"line_number":294,"context_line":"                # if some argument was given multiple times"},{"line_number":295,"context_line":"                if nic_info[k] !\u003d \"\":"},{"line_number":296,"context_line":"                    raise exceptions.CommandError(err_msg)"},{"line_number":297,"context_line":"                nic_info[k] \u003d v"},{"line_number":298,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a5de9d1_3b82ba53","line":295,"range":{"start_line":295,"start_character":19,"end_line":295,"end_character":36},"updated":"2016-01-27 16:28:05.000000000","message":"Make this condition:\n\n    if not nic_info[k]:","commit_id":"8d84aac045a1b66f559e0761677daea303646c59"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"c6f44f680eb8b545172595133bc0b33ea561d8e1","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                    k \u003d \u0027net-id\u0027"},{"line_number":293,"context_line":"                    v \u003d _find_network_id(cs, v)"},{"line_number":294,"context_line":"                # if some argument was given multiple times"},{"line_number":295,"context_line":"                if nic_info[k] !\u003d \"\":"},{"line_number":296,"context_line":"                    raise exceptions.CommandError(err_msg)"},{"line_number":297,"context_line":"                nic_info[k] \u003d v"},{"line_number":298,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a5de9d1_502bc830","line":295,"range":{"start_line":295,"start_character":19,"end_line":295,"end_character":36},"in_reply_to":"7a5de9d1_3b82ba53","updated":"2016-01-27 19:46:14.000000000","message":"oh, sure)","commit_id":"8d84aac045a1b66f559e0761677daea303646c59"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"59e782c7f28897fb82fe40ec2112efebba16c7e8","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                    k \u003d \u0027net-id\u0027"},{"line_number":293,"context_line":"                    v \u003d _find_network_id(cs, v)"},{"line_number":294,"context_line":"                # if some argument was given multiple times"},{"line_number":295,"context_line":"                if nic_info[k] !\u003d \"\":"},{"line_number":296,"context_line":"                    raise exceptions.CommandError(err_msg)"},{"line_number":297,"context_line":"                nic_info[k] \u003d v"},{"line_number":298,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a5de9d1_3341760c","line":295,"range":{"start_line":295,"start_character":19,"end_line":295,"end_character":36},"in_reply_to":"7a5de9d1_502bc830","updated":"2016-01-27 20:08:35.000000000","message":"no :)\n\n    if nic_info[k]:","commit_id":"8d84aac045a1b66f559e0761677daea303646c59"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"37d247c69e012a30e494487cebdb5afaf02f6662","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                    k \u003d \u0027net-id\u0027"},{"line_number":293,"context_line":"                    v \u003d _find_network_id(cs, v)"},{"line_number":294,"context_line":"                # if some argument was given multiple times"},{"line_number":295,"context_line":"                if nic_info[k]:"},{"line_number":296,"context_line":"                    raise exceptions.CommandError(err_msg)"},{"line_number":297,"context_line":"                nic_info[k] \u003d v"},{"line_number":298,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a5de9d1_532bd230","line":295,"updated":"2016-01-27 20:09:51.000000000","message":"Heh, figures; sorry \u0027bout that :)","commit_id":"15d7b403bba2db83726f20c8395e6a7655dbe8d1"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"f8ac03c41367f0556d992788d858141c8ca0f455","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                    k \u003d \u0027net-id\u0027"},{"line_number":293,"context_line":"                    v \u003d _find_network_id(cs, v)"},{"line_number":294,"context_line":"                # if some argument was given multiple times"},{"line_number":295,"context_line":"                if nic_info[k]:"},{"line_number":296,"context_line":"                    raise exceptions.CommandError(err_msg)"},{"line_number":297,"context_line":"                nic_info[k] \u003d v"},{"line_number":298,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a5de9d1_93a62ac0","line":295,"in_reply_to":"7a5de9d1_532bd230","updated":"2016-01-27 20:11:30.000000000","message":":) no problem","commit_id":"15d7b403bba2db83726f20c8395e6a7655dbe8d1"}]}
