)]}'
{"os_net_config/cli.py":[{"author":{"_account_id":18575,"name":"Saravanan KR","email":"krsacme@gmail.com","username":"saravanankr"},"change_message_id":"f2a6be7fd57484630314c1654ad24a82b63c6006","unresolved":false,"context_lines":[{"line_number":186,"context_line":"                # Check to see if the requested iface is a real NIC name"},{"line_number":187,"context_line":"                # (do both so we don\u0027t hide a mapping overlap)."},{"line_number":188,"context_line":"                if requested_nic in mapped_nics.values():"},{"line_number":189,"context_line":"                    reported_nics.append(mapped_nics[requested_nic])"},{"line_number":190,"context_line":"        else:"},{"line_number":191,"context_line":"            reported_nics \u003d mapped_nics"},{"line_number":192,"context_line":"        # Return the report on the mapped NICs. Since no action was taken,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a95cdbc_a63899f0","line":189,"updated":"2016-10-07 09:11:01.000000000","message":"requested_nic is checked in the mapped_nics.values() but it the value is present, the corresponding requested_nic is being added from the key itself, which will throw KeyError as it will be value and not a key.\n\nSample execution below.\n\n[root@rhel os-net-config]# os-net-config -i\n{\u0027nic2\u0027: \u0027eth1\u0027, \u0027nic3\u0027: \u0027eth2\u0027, \u0027nic1\u0027: \u0027eth0\u0027, \u0027nic4\u0027: \u0027eth3\u0027, \u0027nic5\u0027: \u0027eth4\u0027}\n[root@rhel os-net-config]# os-net-config -i nic2\n[\u0027eth1\u0027]\n[root@rhel os-net-config]# os-net-config -i eth1\nTraceback (most recent call last):\n  File \"/usr/bin/os-net-config\", line 10, in \u003cmodule\u003e\n    sys.exit(main())\n  File \"/usr/lib/python2.7/site-packages/os_net_config/cli.py\", line 189, in main\n    reported_nics.append(mapped_nics[requested_nic])\nKeyError: \u0027eth1\u0027","commit_id":"dea6451e5c92c1447eee3c23e47f57b53a1c36cd"},{"author":{"_account_id":12398,"name":"Dan Sneddon","email":"dsneddon@redhat.com","username":"dsneddon"},"change_message_id":"c1de3f0bca91d7617cb46cb024735bfb56c749c8","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        # Return the report on the mapped NICs. Since no action was taken,"},{"line_number":193,"context_line":"        # and the config wasn\u0027t acted on, we don\u0027t return cleanly."},{"line_number":194,"context_line":"        logger.debug(\"Interface report requested, exiting after report.\")"},{"line_number":195,"context_line":"        return reported_nics"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    # Read config file containing network configs to apply"},{"line_number":198,"context_line":"    if os.path.exists(opts.config_file):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a95cdbc_179eda62","line":195,"range":{"start_line":195,"start_character":8,"end_line":195,"end_character":28},"updated":"2016-10-07 07:38:26.000000000","message":"This will cause a return code of \"1\" whenever an interface report is requested. If needed, this could return \"0\" if all requested nics were found (or if none specified), and return \"1\" if one or more requested nics was not found, or down, or whatever.","commit_id":"dea6451e5c92c1447eee3c23e47f57b53a1c36cd"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"3bab0e89117a5cf5db4d5c74eede5614dc9edba7","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        retval \u003d 0"},{"line_number":182,"context_line":"        if len(opts.interfaces) \u003e 0:"},{"line_number":183,"context_line":"            for requested_nic in opts.interfaces:"},{"line_number":184,"context_line":"                found \u003d 0"},{"line_number":185,"context_line":"                # Check to see if requested iface is a mapped NIC name."},{"line_number":186,"context_line":"                if requested_nic in mapped_nics:"},{"line_number":187,"context_line":"                    reported_nics.append(mapped_nics[requested_nic])"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa6399be_5088b722","line":184,"range":{"start_line":184,"start_character":16,"end_line":184,"end_character":25},"updated":"2016-10-12 02:12:31.000000000","message":"Nit - as \u0027found\u0027 is treated as boolean, better to use \u0027found \u003d False\u0027 here and \u0027found \u003d True\u0027 below","commit_id":"c4105d00fd212d94523e0464733c3fedf7a66076"},{"author":{"_account_id":17280,"name":"Tim Rozet","email":"trozet@redhat.com","username":"trozet"},"change_message_id":"0b1a41681c692d64c965213d18e8e41e2a3429c8","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                found \u003d False"},{"line_number":185,"context_line":"                # Check to see if requested iface is a mapped NIC name."},{"line_number":186,"context_line":"                if requested_nic in mapped_nics:"},{"line_number":187,"context_line":"                    reported_nics.append(mapped_nics[requested_nic])"},{"line_number":188,"context_line":"                    found \u003d True"},{"line_number":189,"context_line":"                # Check to see if the requested iface is a real NIC name"},{"line_number":190,"context_line":"                # (do both so we don\u0027t hide a mapping overlap)."}],"source_content_type":"text/x-python","patch_set":6,"id":"da6895a0_5bd28001","line":187,"range":{"start_line":187,"start_character":20,"end_line":187,"end_character":68},"updated":"2016-10-24 19:24:53.000000000","message":"why are you creating a list here?  If the logical nic is provided, wouldn\u0027t there only ever be one physical nic that maps to it?  Then you can just return the value here as well.","commit_id":"4e90ae4b3a8da657b34f4642b54c62356e35a654"},{"author":{"_account_id":12398,"name":"Dan Sneddon","email":"dsneddon@redhat.com","username":"dsneddon"},"change_message_id":"c2d5345a740705a79023703fd8f9297ae2e422a1","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                found \u003d False"},{"line_number":185,"context_line":"                # Check to see if requested iface is a mapped NIC name."},{"line_number":186,"context_line":"                if requested_nic in mapped_nics:"},{"line_number":187,"context_line":"                    reported_nics.append(mapped_nics[requested_nic])"},{"line_number":188,"context_line":"                    found \u003d True"},{"line_number":189,"context_line":"                # Check to see if the requested iface is a real NIC name"},{"line_number":190,"context_line":"                # (do both so we don\u0027t hide a mapping overlap)."}],"source_content_type":"text/x-python","patch_set":6,"id":"7a77a97e_1c632f43","line":187,"range":{"start_line":187,"start_character":20,"end_line":187,"end_character":68},"in_reply_to":"da6895a0_5bd28001","updated":"2016-11-21 22:18:06.000000000","message":"We don\u0027t do any validation to ensure you don\u0027t map a nic to a name that overlaps with a physical NIC. In that case, we want to make sure that we report on both mappings: [em2:em1, em2:em2]. I tried to make this clear in the comment below \"(do both so we don\u0027t hide a mapping overlap)\", but maybe I can make it more clear.","commit_id":"4e90ae4b3a8da657b34f4642b54c62356e35a654"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"559e89b4b3fe611de8de8ee4c854805bb04fc42d","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                found \u003d False"},{"line_number":185,"context_line":"                # Check to see if requested iface is a mapped NIC name."},{"line_number":186,"context_line":"                if requested_nic in mapped_nics:"},{"line_number":187,"context_line":"                    reported_nics.append(mapped_nics[requested_nic])"},{"line_number":188,"context_line":"                    found \u003d True"},{"line_number":189,"context_line":"                # Check to see if the requested iface is a real NIC name"},{"line_number":190,"context_line":"                # (do both so we don\u0027t hide a mapping overlap)."}],"source_content_type":"text/x-python","patch_set":6,"id":"bf3e73b7_fd447eb9","line":187,"range":{"start_line":187,"start_character":20,"end_line":187,"end_character":68},"in_reply_to":"da6895a0_5bd28001","updated":"2017-08-07 10:05:39.000000000","message":"it might be useful to create a list here, for example, when several logical nics are provided to \u0027--interface\u0027 flag, there will be a dict of the NIC mappings :\n\n(.net) [root@nfv os-net-config]# os-net-config -i nic1 nic2\n[\u0027em1\u0027, \u0027em3\u0027]","commit_id":"4e90ae4b3a8da657b34f4642b54c62356e35a654"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"eca0e8b227b52390824055b829ccbc7ae78ff4d9","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                # Check to see if requested iface is a mapped NIC name."},{"line_number":186,"context_line":"                if requested_nic in mapped_nics:"},{"line_number":187,"context_line":"                    reported_nics \u003d mapped_nics[requested_nic]"},{"line_number":188,"context_line":"                    found \u003d True"},{"line_number":189,"context_line":"                # Check to see if the requested iface is a real NIC name"},{"line_number":190,"context_line":"                if requested_nic in mapped_nics.values():"},{"line_number":191,"context_line":"                    if found \u003d\u003d True:  # Name matches alias and real NIC"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_ead66826","line":188,"updated":"2016-12-07 16:42:48.000000000","message":"Could remove use of \u0027found\u0027 variable by checking whether or not reported_nics is set.","commit_id":"3f918df4f8ed32e1d59678ce17fcd5364e4e9f9d"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6a4f9fffdf9adb2f6fe98503b96a79d8e3de2161","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                # Check to see if requested iface is a mapped NIC name."},{"line_number":186,"context_line":"                if requested_nic in mapped_nics:"},{"line_number":187,"context_line":"                    reported_nics \u003d mapped_nics[requested_nic]"},{"line_number":188,"context_line":"                    found \u003d True"},{"line_number":189,"context_line":"                # Check to see if the requested iface is a real NIC name"},{"line_number":190,"context_line":"                if requested_nic in mapped_nics.values():"},{"line_number":191,"context_line":"                    if found \u003d\u003d True:  # Name matches alias and real NIC"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_959a046c","line":188,"in_reply_to":"3a71b18c_ead66826","updated":"2017-08-08 02:35:06.000000000","message":"reported_nics may be a list of real interface names when user requests a list of logical names or real interface names; the scope of \u0027found\u0027 here would be in each of the for loops, so keep as it is.","commit_id":"3f918df4f8ed32e1d59678ce17fcd5364e4e9f9d"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"eca0e8b227b52390824055b829ccbc7ae78ff4d9","unresolved":false,"context_lines":[{"line_number":188,"context_line":"                    found \u003d True"},{"line_number":189,"context_line":"                # Check to see if the requested iface is a real NIC name"},{"line_number":190,"context_line":"                if requested_nic in mapped_nics.values():"},{"line_number":191,"context_line":"                    if found \u003d\u003d True:  # Name matches alias and real NIC"},{"line_number":192,"context_line":"                        # (return the mapped NIC, but warn of overlap)."},{"line_number":193,"context_line":"                        logger.warning(\u0027\"%s\" overlaps with real NIC name.\u0027"},{"line_number":194,"context_line":"                                       % (requested_nic))"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_ca99acd2","line":191,"updated":"2016-12-07 16:42:48.000000000","message":"Should be:\nif found is True:\n...\n(see pep8 error in Jenkins)\n\nor better, if remove \u0027found\u0027 could do:\nif reported_nics:\n...","commit_id":"3f918df4f8ed32e1d59678ce17fcd5364e4e9f9d"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6a4f9fffdf9adb2f6fe98503b96a79d8e3de2161","unresolved":false,"context_lines":[{"line_number":188,"context_line":"                    found \u003d True"},{"line_number":189,"context_line":"                # Check to see if the requested iface is a real NIC name"},{"line_number":190,"context_line":"                if requested_nic in mapped_nics.values():"},{"line_number":191,"context_line":"                    if found \u003d\u003d True:  # Name matches alias and real NIC"},{"line_number":192,"context_line":"                        # (return the mapped NIC, but warn of overlap)."},{"line_number":193,"context_line":"                        logger.warning(\u0027\"%s\" overlaps with real NIC name.\u0027"},{"line_number":194,"context_line":"                                       % (requested_nic))"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_d51d2c10","line":191,"in_reply_to":"3a71b18c_ca99acd2","updated":"2017-08-08 02:35:06.000000000","message":"Done","commit_id":"3f918df4f8ed32e1d59678ce17fcd5364e4e9f9d"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"eca0e8b227b52390824055b829ccbc7ae78ff4d9","unresolved":false,"context_lines":[{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    # Read config file containing network configs to apply"},{"line_number":209,"context_line":"    if os.path.exists(opts.config_file):"},{"line_number":210,"context_line":"        with open(opts.config_file) as cf:"},{"line_number":211,"context_line":"            iface_array \u003d yaml.load(cf.read()).get(\"network_config\")"},{"line_number":212,"context_line":"            logger.debug(\u0027network_config JSON: %s\u0027 % str(iface_array))"},{"line_number":213,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_20879fd8","line":210,"updated":"2016-12-07 16:42:48.000000000","message":"Perhaps add try block here around the open()?","commit_id":"3f918df4f8ed32e1d59678ce17fcd5364e4e9f9d"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6a4f9fffdf9adb2f6fe98503b96a79d8e3de2161","unresolved":false,"context_lines":[{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    # Read config file containing network configs to apply"},{"line_number":209,"context_line":"    if os.path.exists(opts.config_file):"},{"line_number":210,"context_line":"        with open(opts.config_file) as cf:"},{"line_number":211,"context_line":"            iface_array \u003d yaml.load(cf.read()).get(\"network_config\")"},{"line_number":212,"context_line":"            logger.debug(\u0027network_config JSON: %s\u0027 % str(iface_array))"},{"line_number":213,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_9517a4ee","line":210,"in_reply_to":"3a71b18c_20879fd8","updated":"2017-08-08 02:35:06.000000000","message":"Done","commit_id":"3f918df4f8ed32e1d59678ce17fcd5364e4e9f9d"},{"author":{"_account_id":18575,"name":"Saravanan KR","email":"krsacme@gmail.com","username":"saravanankr"},"change_message_id":"cf697d6210140c485e18f6f326c337ce0830b2d8","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    # If --interfaces is specified, either return the real name of the"},{"line_number":184,"context_line":"    # interfaces specified, or return the map of all nic abstractions/names."},{"line_number":185,"context_line":"    if opts.interfaces is not None:"},{"line_number":186,"context_line":"        logger.debug(\"Interface mapping requested for interfaces: %s\" %"},{"line_number":187,"context_line":"                     opts.interfaces)"},{"line_number":188,"context_line":"        reported_nics \u003d []"},{"line_number":189,"context_line":"        mapped_nics \u003d objects._mapped_nics(iface_mapping)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f436f4f_295e61e6","line":186,"updated":"2017-08-08 08:07:53.000000000","message":"Can we move this log message inside the if condition, to print only if there are valid list of interfaces?","commit_id":"249c3331c8ab9db64c6e669d213f6d5e8c232a12"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"7765d38caa98757d1e0c8e9de575862573318e5b","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    # If --interfaces is specified, either return the real name of the"},{"line_number":184,"context_line":"    # interfaces specified, or return the map of all nic abstractions/names."},{"line_number":185,"context_line":"    if opts.interfaces is not None:"},{"line_number":186,"context_line":"        logger.debug(\"Interface mapping requested for interfaces: %s\" %"},{"line_number":187,"context_line":"                     opts.interfaces)"},{"line_number":188,"context_line":"        reported_nics \u003d []"},{"line_number":189,"context_line":"        mapped_nics \u003d objects._mapped_nics(iface_mapping)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f436f4f_0e7dde1b","line":186,"in_reply_to":"9f436f4f_295e61e6","updated":"2017-08-08 09:35:39.000000000","message":"Done","commit_id":"249c3331c8ab9db64c6e669d213f6d5e8c232a12"},{"author":{"_account_id":18575,"name":"Saravanan KR","email":"krsacme@gmail.com","username":"saravanankr"},"change_message_id":"cf697d6210140c485e18f6f326c337ce0830b2d8","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        # Return the report on the mapped NICs. If all NICs were found, exit"},{"line_number":212,"context_line":"        # cleanly, otherwise exit with status 1."},{"line_number":213,"context_line":"        logger.debug(\"Interface report requested, exiting after report.\")"},{"line_number":214,"context_line":"        print(reported_nics)"},{"line_number":215,"context_line":"        return retval"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    # Read config file containing network configs to apply"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f436f4f_e472c0e3","line":214,"updated":"2017-08-08 08:07:53.000000000","message":"The format of stdout is different for with/without interfaces:\n\nwithout interface names:\n  {\u0027nic1\u0027: \u0027eth0\u0027, \u0027nic2\u0027: \u0027eth1\u0027}\n\nwith interface names (-i nic1)\n  [\u0027eth0\u0027]\n\nIt is preferable to keep the format as same with and without additional filter.","commit_id":"249c3331c8ab9db64c6e669d213f6d5e8c232a12"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"7765d38caa98757d1e0c8e9de575862573318e5b","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        # Return the report on the mapped NICs. If all NICs were found, exit"},{"line_number":212,"context_line":"        # cleanly, otherwise exit with status 1."},{"line_number":213,"context_line":"        logger.debug(\"Interface report requested, exiting after report.\")"},{"line_number":214,"context_line":"        print(reported_nics)"},{"line_number":215,"context_line":"        return retval"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    # Read config file containing network configs to apply"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f436f4f_ee797a2f","line":214,"in_reply_to":"9f436f4f_e472c0e3","updated":"2017-08-08 09:35:39.000000000","message":"Done","commit_id":"249c3331c8ab9db64c6e669d213f6d5e8c232a12"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"d128a599c1890574aeb9556c8f1101aebcd14bef","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                        help\u003d\"\"\"path to the interface mapping file.\"\"\","},{"line_number":44,"context_line":"                        default\u003d\u0027/etc/os-net-config/mapping.yaml\u0027)"},{"line_number":45,"context_line":"    parser.add_argument(\u0027-i\u0027, \u0027--interfaces\u0027, metavar\u003d\u0027INTERFACES\u0027,"},{"line_number":46,"context_line":"                        help\u003d\"\"\"Identify the real interface for a nic name.\"\"\""},{"line_number":47,"context_line":"                        \"\"\"If a real name is given, it is returned if live.\"\"\""},{"line_number":48,"context_line":"                        \"\"\"If no value is given, display full NIC mapping.\"\"\""},{"line_number":49,"context_line":"                        \"\"\"Exit after printing, ignoring other parameters.\"\"\","}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_c765a2b6","line":46,"range":{"start_line":46,"start_character":75,"end_line":46,"end_character":76},"updated":"2017-08-16 14:46:13.000000000","message":"nit - could you add a space at the end of the lines so there is a space after \u0027.\u0027.  We have that problem with other help for this command which results in, for example:\n-p PROVIDER, --provider PROVIDER\n                        The provider to use.One of: ifcfg, eni, iproute.","commit_id":"0aa8c9f1bcdebc49ced32d8c5d15cb225feb2b24"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6c04777804fe70113d5fa1d7e2a550112b62d010","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                        help\u003d\"\"\"path to the interface mapping file.\"\"\","},{"line_number":44,"context_line":"                        default\u003d\u0027/etc/os-net-config/mapping.yaml\u0027)"},{"line_number":45,"context_line":"    parser.add_argument(\u0027-i\u0027, \u0027--interfaces\u0027, metavar\u003d\u0027INTERFACES\u0027,"},{"line_number":46,"context_line":"                        help\u003d\"\"\"Identify the real interface for a nic name.\"\"\""},{"line_number":47,"context_line":"                        \"\"\"If a real name is given, it is returned if live.\"\"\""},{"line_number":48,"context_line":"                        \"\"\"If no value is given, display full NIC mapping.\"\"\""},{"line_number":49,"context_line":"                        \"\"\"Exit after printing, ignoring other parameters.\"\"\","}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_445ab982","line":46,"range":{"start_line":46,"start_character":75,"end_line":46,"end_character":76},"in_reply_to":"9f436f4f_c765a2b6","updated":"2017-08-17 08:31:23.000000000","message":"Done","commit_id":"0aa8c9f1bcdebc49ced32d8c5d15cb225feb2b24"},{"author":{"_account_id":20971,"name":"Feng Pan","email":"fpan@redhat.com","username":"fpan"},"change_message_id":"1a532dd73f5482f0a51bf5945b430974200b57e6","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    # interfaces specified, or return the map of all nic abstractions/names."},{"line_number":185,"context_line":"    if opts.interfaces is not None:"},{"line_number":186,"context_line":"        reported_nics \u003d {}"},{"line_number":187,"context_line":"        mapped_nics \u003d objects._mapped_nics(iface_mapping)"},{"line_number":188,"context_line":"        retval \u003d 0"},{"line_number":189,"context_line":"        if len(opts.interfaces) \u003e 0:"},{"line_number":190,"context_line":"            for requested_nic in opts.interfaces:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f436f4f_91356fab","line":187,"range":{"start_line":187,"start_character":30,"end_line":187,"end_character":42},"updated":"2017-08-17 19:44:12.000000000","message":"Change this to public function","commit_id":"79741e6103ca22d5475387bb11323bc34f55c5a0"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6be81305829f2d49a3a9a6ecd50e5d0efe4716f0","unresolved":false,"context_lines":[{"line_number":184,"context_line":"    # interfaces specified, or return the map of all nic abstractions/names."},{"line_number":185,"context_line":"    if opts.interfaces is not None:"},{"line_number":186,"context_line":"        reported_nics \u003d {}"},{"line_number":187,"context_line":"        mapped_nics \u003d objects._mapped_nics(iface_mapping)"},{"line_number":188,"context_line":"        retval \u003d 0"},{"line_number":189,"context_line":"        if len(opts.interfaces) \u003e 0:"},{"line_number":190,"context_line":"            for requested_nic in opts.interfaces:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f436f4f_2a3765e6","line":187,"range":{"start_line":187,"start_character":30,"end_line":187,"end_character":42},"in_reply_to":"9f436f4f_91356fab","updated":"2017-08-18 02:30:40.000000000","message":"Done","commit_id":"79741e6103ca22d5475387bb11323bc34f55c5a0"}],"os_net_config/objects.py":[{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"d128a599c1890574aeb9556c8f1101aebcd14bef","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            # (However using the name of an inactive NIC as an alias is"},{"line_number":160,"context_line":"            # permitted)."},{"line_number":161,"context_line":"            if utils._is_active_nic(nic_alias):"},{"line_number":162,"context_line":"                msg \u003d (\u0027cannot map %s to alias %s, alias overlaps with active\u0027"},{"line_number":163,"context_line":"                       \u0027NIC.\u0027 % (nic_mapped, nic_alias))"},{"line_number":164,"context_line":"                raise InvalidConfigException(msg)"},{"line_number":165,"context_line":"            elif utils._is_real_nic(nic_alias):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_07c3aa58","line":162,"range":{"start_line":162,"start_character":77,"end_line":162,"end_character":78},"updated":"2017-08-16 14:46:13.000000000","message":"nit - can you add a space here as this will print as \"activeNic\"","commit_id":"0aa8c9f1bcdebc49ced32d8c5d15cb225feb2b24"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6c04777804fe70113d5fa1d7e2a550112b62d010","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            # (However using the name of an inactive NIC as an alias is"},{"line_number":160,"context_line":"            # permitted)."},{"line_number":161,"context_line":"            if utils._is_active_nic(nic_alias):"},{"line_number":162,"context_line":"                msg \u003d (\u0027cannot map %s to alias %s, alias overlaps with active\u0027"},{"line_number":163,"context_line":"                       \u0027NIC.\u0027 % (nic_mapped, nic_alias))"},{"line_number":164,"context_line":"                raise InvalidConfigException(msg)"},{"line_number":165,"context_line":"            elif utils._is_real_nic(nic_alias):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_245d7578","line":162,"range":{"start_line":162,"start_character":77,"end_line":162,"end_character":78},"in_reply_to":"9f436f4f_07c3aa58","updated":"2017-08-17 08:31:23.000000000","message":"Done","commit_id":"0aa8c9f1bcdebc49ced32d8c5d15cb225feb2b24"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"d128a599c1890574aeb9556c8f1101aebcd14bef","unresolved":false,"context_lines":[{"line_number":160,"context_line":"            # permitted)."},{"line_number":161,"context_line":"            if utils._is_active_nic(nic_alias):"},{"line_number":162,"context_line":"                msg \u003d (\u0027cannot map %s to alias %s, alias overlaps with active\u0027"},{"line_number":163,"context_line":"                       \u0027NIC.\u0027 % (nic_mapped, nic_alias))"},{"line_number":164,"context_line":"                raise InvalidConfigException(msg)"},{"line_number":165,"context_line":"            elif utils._is_real_nic(nic_alias):"},{"line_number":166,"context_line":"                logger.warning(\"Mapped nic %s overlaps with name of inactive\""}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_8242e80d","line":163,"updated":"2017-08-16 14:46:13.000000000","message":"Would like to see a test added to the mapping tests in test_objects.py for these changes.","commit_id":"0aa8c9f1bcdebc49ced32d8c5d15cb225feb2b24"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6c04777804fe70113d5fa1d7e2a550112b62d010","unresolved":false,"context_lines":[{"line_number":160,"context_line":"            # permitted)."},{"line_number":161,"context_line":"            if utils._is_active_nic(nic_alias):"},{"line_number":162,"context_line":"                msg \u003d (\u0027cannot map %s to alias %s, alias overlaps with active\u0027"},{"line_number":163,"context_line":"                       \u0027NIC.\u0027 % (nic_mapped, nic_alias))"},{"line_number":164,"context_line":"                raise InvalidConfigException(msg)"},{"line_number":165,"context_line":"            elif utils._is_real_nic(nic_alias):"},{"line_number":166,"context_line":"                logger.warning(\"Mapped nic %s overlaps with name of inactive\""}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_c4e229a0","line":163,"in_reply_to":"9f436f4f_8242e80d","updated":"2017-08-17 08:31:23.000000000","message":"add two tests in test_objects.py\n1) test_mapped_nics_mapping_overlap_real_nic_name\n2) test_mapped_nics_mapping_inactive_name_as_alias","commit_id":"0aa8c9f1bcdebc49ced32d8c5d15cb225feb2b24"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"d128a599c1890574aeb9556c8f1101aebcd14bef","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                       \u0027NIC.\u0027 % (nic_mapped, nic_alias))"},{"line_number":164,"context_line":"                raise InvalidConfigException(msg)"},{"line_number":165,"context_line":"            elif utils._is_real_nic(nic_alias):"},{"line_number":166,"context_line":"                logger.warning(\"Mapped nic %s overlaps with name of inactive\""},{"line_number":167,"context_line":"                               \"NIC.\" % (nic_alias))"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"            _MAPPED_NICS[nic_alias] \u003d nic_mapped"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_e7a306b1","line":166,"range":{"start_line":166,"start_character":76,"end_line":166,"end_character":77},"updated":"2017-08-16 14:46:13.000000000","message":"nit - please add space as this will print as \"inactiveNic\"","commit_id":"0aa8c9f1bcdebc49ced32d8c5d15cb225feb2b24"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6c04777804fe70113d5fa1d7e2a550112b62d010","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                       \u0027NIC.\u0027 % (nic_mapped, nic_alias))"},{"line_number":164,"context_line":"                raise InvalidConfigException(msg)"},{"line_number":165,"context_line":"            elif utils._is_real_nic(nic_alias):"},{"line_number":166,"context_line":"                logger.warning(\"Mapped nic %s overlaps with name of inactive\""},{"line_number":167,"context_line":"                               \"NIC.\" % (nic_alias))"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"            _MAPPED_NICS[nic_alias] \u003d nic_mapped"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_c44d89c4","line":166,"range":{"start_line":166,"start_character":76,"end_line":166,"end_character":77},"in_reply_to":"9f436f4f_e7a306b1","updated":"2017-08-17 08:31:23.000000000","message":"Done","commit_id":"0aa8c9f1bcdebc49ced32d8c5d15cb225feb2b24"},{"author":{"_account_id":20971,"name":"Feng Pan","email":"fpan@redhat.com","username":"fpan"},"change_message_id":"1a532dd73f5482f0a51bf5945b430974200b57e6","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            # Using a mapping name that overlaps with a real NIC is not allowed"},{"line_number":159,"context_line":"            # (However using the name of an inactive NIC as an alias is"},{"line_number":160,"context_line":"            # permitted)."},{"line_number":161,"context_line":"            if utils._is_active_nic(nic_alias):"},{"line_number":162,"context_line":"                msg \u003d (\u0027cannot map %s to alias %s, alias overlaps with active \u0027"},{"line_number":163,"context_line":"                       \u0027NIC.\u0027 % (nic_mapped, nic_alias))"},{"line_number":164,"context_line":"                raise InvalidConfigException(msg)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f436f4f_3181234c","line":161,"range":{"start_line":161,"start_character":21,"end_line":161,"end_character":35},"updated":"2017-08-17 19:44:12.000000000","message":"Change this function to public (is_active_nic) since you are calling it outside of utils.","commit_id":"79741e6103ca22d5475387bb11323bc34f55c5a0"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6be81305829f2d49a3a9a6ecd50e5d0efe4716f0","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            # Using a mapping name that overlaps with a real NIC is not allowed"},{"line_number":159,"context_line":"            # (However using the name of an inactive NIC as an alias is"},{"line_number":160,"context_line":"            # permitted)."},{"line_number":161,"context_line":"            if utils._is_active_nic(nic_alias):"},{"line_number":162,"context_line":"                msg \u003d (\u0027cannot map %s to alias %s, alias overlaps with active \u0027"},{"line_number":163,"context_line":"                       \u0027NIC.\u0027 % (nic_mapped, nic_alias))"},{"line_number":164,"context_line":"                raise InvalidConfigException(msg)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f436f4f_0a34a1dd","line":161,"range":{"start_line":161,"start_character":21,"end_line":161,"end_character":35},"in_reply_to":"9f436f4f_3181234c","updated":"2017-08-18 02:30:40.000000000","message":"Done","commit_id":"79741e6103ca22d5475387bb11323bc34f55c5a0"},{"author":{"_account_id":20971,"name":"Feng Pan","email":"fpan@redhat.com","username":"fpan"},"change_message_id":"1a532dd73f5482f0a51bf5945b430974200b57e6","unresolved":false,"context_lines":[{"line_number":162,"context_line":"                msg \u003d (\u0027cannot map %s to alias %s, alias overlaps with active \u0027"},{"line_number":163,"context_line":"                       \u0027NIC.\u0027 % (nic_mapped, nic_alias))"},{"line_number":164,"context_line":"                raise InvalidConfigException(msg)"},{"line_number":165,"context_line":"            elif utils._is_real_nic(nic_alias):"},{"line_number":166,"context_line":"                logger.warning(\"Mapped nic %s overlaps with name of inactive \""},{"line_number":167,"context_line":"                               \"NIC.\" % (nic_alias))"},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9f436f4f_11961f96","line":165,"range":{"start_line":165,"start_character":23,"end_line":165,"end_character":35},"updated":"2017-08-17 19:44:12.000000000","message":"same as above","commit_id":"79741e6103ca22d5475387bb11323bc34f55c5a0"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6be81305829f2d49a3a9a6ecd50e5d0efe4716f0","unresolved":false,"context_lines":[{"line_number":162,"context_line":"                msg \u003d (\u0027cannot map %s to alias %s, alias overlaps with active \u0027"},{"line_number":163,"context_line":"                       \u0027NIC.\u0027 % (nic_mapped, nic_alias))"},{"line_number":164,"context_line":"                raise InvalidConfigException(msg)"},{"line_number":165,"context_line":"            elif utils._is_real_nic(nic_alias):"},{"line_number":166,"context_line":"                logger.warning(\"Mapped nic %s overlaps with name of inactive \""},{"line_number":167,"context_line":"                               \"NIC.\" % (nic_alias))"},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9f436f4f_ea303deb","line":165,"range":{"start_line":165,"start_character":23,"end_line":165,"end_character":35},"in_reply_to":"9f436f4f_11961f96","updated":"2017-08-18 02:30:40.000000000","message":"Done","commit_id":"79741e6103ca22d5475387bb11323bc34f55c5a0"}],"os_net_config/tests/test_cli.py":[{"author":{"_account_id":18575,"name":"Saravanan KR","email":"krsacme@gmail.com","username":"saravanankr"},"change_message_id":"8ce7e9a8af0a991fabcbbad9a37d10860ed1cb33","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            self.assertIn(dev, stdout_yaml)"},{"line_number":239,"context_line":"        self.assertEqual(stdout_yaml, stdout_json)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def test_nic_mapping_report_output(self):"},{"line_number":242,"context_line":"        mapping_report \u003d os.path.join(SAMPLE_BASE, \u0027mapping_report.yaml\u0027)"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        def dummy_mapped_nics(nic_mapping\u003dNone):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_2cb1ca90","line":241,"updated":"2017-08-08 11:05:45.000000000","message":"Add a test for explicit interface name case too.","commit_id":"c92ecbec71b11b692e8243f7f00efa4c3ab69092"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"e5b67acac0eb1f4cc859065824ed67b05b767764","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            self.assertIn(dev, stdout_yaml)"},{"line_number":239,"context_line":"        self.assertEqual(stdout_yaml, stdout_json)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def test_nic_mapping_report_output(self):"},{"line_number":242,"context_line":"        mapping_report \u003d os.path.join(SAMPLE_BASE, \u0027mapping_report.yaml\u0027)"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        def dummy_mapped_nics(nic_mapping\u003dNone):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_f49ff2b1","line":241,"in_reply_to":"9f436f4f_2cb1ca90","updated":"2017-08-09 02:08:46.000000000","message":"Done","commit_id":"c92ecbec71b11b692e8243f7f00efa4c3ab69092"},{"author":{"_account_id":18575,"name":"Saravanan KR","email":"krsacme@gmail.com","username":"saravanankr"},"change_message_id":"de560ca9e469901a52c892ebd624afea7905bba1","unresolved":false,"context_lines":[{"line_number":266,"context_line":"                                      \u0027--exit-on-validation-errors \u0027"},{"line_number":267,"context_line":"                                      \u0027-m %s\u0027 % mapping_report)"},{"line_number":268,"context_line":"        self.assertEqual(\u0027\u0027, stderr)"},{"line_number":269,"context_line":"        stdout_list \u003d yaml.load(stdout)"},{"line_number":270,"context_line":"        self.assertEqual(stdout_list[\u0027em2\u0027], \u0027em2\u0027)"},{"line_number":271,"context_line":"        self.assertEqual(stdout_list[\u0027em3\u0027], \u0027em3\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f436f4f_4d474c1f","line":269,"updated":"2017-08-09 08:26:12.000000000","message":"You could also add a condition for nic1 not to be present, that way it validates the expected output.","commit_id":"11892d4fab3f6fc667ca104c474d8fc593b8e184"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"e83add96e72a639d6826b40df3c3cf827c101b55","unresolved":false,"context_lines":[{"line_number":266,"context_line":"                                      \u0027--exit-on-validation-errors \u0027"},{"line_number":267,"context_line":"                                      \u0027-m %s\u0027 % mapping_report)"},{"line_number":268,"context_line":"        self.assertEqual(\u0027\u0027, stderr)"},{"line_number":269,"context_line":"        stdout_list \u003d yaml.load(stdout)"},{"line_number":270,"context_line":"        self.assertEqual(stdout_list[\u0027em2\u0027], \u0027em2\u0027)"},{"line_number":271,"context_line":"        self.assertEqual(stdout_list[\u0027em3\u0027], \u0027em3\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f436f4f_0884925d","line":269,"in_reply_to":"9f436f4f_4d474c1f","updated":"2017-08-09 08:57:59.000000000","message":"will add assertion of \u0027em1\u0027 against the output keys.\nlike : self.assertNotIn(\u0027em1\u0027, stdout_list.keys())","commit_id":"11892d4fab3f6fc667ca104c474d8fc593b8e184"},{"author":{"_account_id":18575,"name":"Saravanan KR","email":"krsacme@gmail.com","username":"saravanankr"},"change_message_id":"de560ca9e469901a52c892ebd624afea7905bba1","unresolved":false,"context_lines":[{"line_number":267,"context_line":"                                      \u0027-m %s\u0027 % mapping_report)"},{"line_number":268,"context_line":"        self.assertEqual(\u0027\u0027, stderr)"},{"line_number":269,"context_line":"        stdout_list \u003d yaml.load(stdout)"},{"line_number":270,"context_line":"        self.assertEqual(stdout_list[\u0027em2\u0027], \u0027em2\u0027)"},{"line_number":271,"context_line":"        self.assertEqual(stdout_list[\u0027em3\u0027], \u0027em3\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f436f4f_2d6d2898","line":270,"range":{"start_line":270,"start_character":38,"end_line":270,"end_character":41},"updated":"2017-08-09 08:26:12.000000000","message":"Is this the output that we expect while we pass interface as input? Like {\u0027em2\u0027: \u0027em2\u0027, \u0027em3\u0027: \u0027em3\u0027}?","commit_id":"11892d4fab3f6fc667ca104c474d8fc593b8e184"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"e83add96e72a639d6826b40df3c3cf827c101b55","unresolved":false,"context_lines":[{"line_number":267,"context_line":"                                      \u0027-m %s\u0027 % mapping_report)"},{"line_number":268,"context_line":"        self.assertEqual(\u0027\u0027, stderr)"},{"line_number":269,"context_line":"        stdout_list \u003d yaml.load(stdout)"},{"line_number":270,"context_line":"        self.assertEqual(stdout_list[\u0027em2\u0027], \u0027em2\u0027)"},{"line_number":271,"context_line":"        self.assertEqual(stdout_list[\u0027em3\u0027], \u0027em3\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f436f4f_8debf4ae","line":270,"range":{"start_line":270,"start_character":38,"end_line":270,"end_character":41},"in_reply_to":"9f436f4f_2d6d2898","updated":"2017-08-09 08:57:59.000000000","message":"yes, if we pass real interface name as input, the output key \u0026 value would be that name.\nfor example:\nexecute: os-net-config -i em2\nget : {\u0027em2\u0027: \u0027em2\u0027}\n\nI think this is the expected behavior as mentioned in the commit message: If a real interface name is given, it will be returned in the list without translation only if it is live.","commit_id":"11892d4fab3f6fc667ca104c474d8fc593b8e184"},{"author":{"_account_id":18575,"name":"Saravanan KR","email":"krsacme@gmail.com","username":"saravanankr"},"change_message_id":"e9aae95dcec99e36958b4fd65c9bc2fc2a7b8e06","unresolved":false,"context_lines":[{"line_number":267,"context_line":"                                      \u0027-m %s\u0027 % mapping_report)"},{"line_number":268,"context_line":"        self.assertEqual(\u0027\u0027, stderr)"},{"line_number":269,"context_line":"        stdout_list \u003d yaml.load(stdout)"},{"line_number":270,"context_line":"        self.assertEqual(stdout_list[\u0027em2\u0027], \u0027em2\u0027)"},{"line_number":271,"context_line":"        self.assertEqual(stdout_list[\u0027em3\u0027], \u0027em3\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f436f4f_c36f8dc3","line":270,"range":{"start_line":270,"start_character":38,"end_line":270,"end_character":41},"in_reply_to":"9f436f4f_8debf4ae","updated":"2017-08-09 09:31:48.000000000","message":"Got it. Thanks. The map output in this case misleads, probably your earlier way of having 2 different print format for with/without interface names make more sense in this case. Sorry for misleading here. May we can take others opinion.","commit_id":"11892d4fab3f6fc667ca104c474d8fc593b8e184"}],"os_net_config/utils.py":[{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"eca0e8b227b52390824055b829ccbc7ae78ff4d9","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"def _is_real_nic(interface_name):"},{"line_number":119,"context_line":"    try:"},{"line_number":120,"context_line":"        if interface_name \u003d\u003d \u0027lo\u0027:"},{"line_number":121,"context_line":"            return True"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a71b18c_0f3ad6e7","line":119,"updated":"2016-12-07 16:42:48.000000000","message":"Could just do this try block around the open() as that\u0027s where the IOError would occur.","commit_id":"3f918df4f8ed32e1d59678ce17fcd5364e4e9f9d"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6a4f9fffdf9adb2f6fe98503b96a79d8e3de2161","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"def _is_real_nic(interface_name):"},{"line_number":119,"context_line":"    try:"},{"line_number":120,"context_line":"        if interface_name \u003d\u003d \u0027lo\u0027:"},{"line_number":121,"context_line":"            return True"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_f520304c","line":119,"in_reply_to":"3a71b18c_0f3ad6e7","updated":"2017-08-08 02:35:06.000000000","message":"Done","commit_id":"3f918df4f8ed32e1d59678ce17fcd5364e4e9f9d"},{"author":{"_account_id":17280,"name":"Tim Rozet","email":"trozet@redhat.com","username":"trozet"},"change_message_id":"ad33f1ae07984f2c11220de701c3a91bc02cd3b9","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"def _is_available_nic(interface_name, check_active\u003dTrue):"},{"line_number":107,"context_line":"    try:"},{"line_number":108,"context_line":"        if interface_name \u003d\u003d \u0027lo\u0027:"},{"line_number":109,"context_line":"            return False"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        device_dir \u003d _SYS_CLASS_NET + \u0027/%s/device\u0027 % interface_name"},{"line_number":112,"context_line":"        has_device_dir \u003d os.path.isdir(device_dir)"},{"line_number":113,"context_line":"        if not has_device_dir:"},{"line_number":114,"context_line":"            return False"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        operstate \u003d None"},{"line_number":117,"context_line":"        with open(_SYS_CLASS_NET + \u0027/%s/operstate\u0027 % interface_name, \u0027r\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f436f4f_91d0cf55","line":114,"range":{"start_line":108,"start_character":2,"end_line":114,"end_character":24},"updated":"2017-08-17 19:34:05.000000000","message":"you can replace this (along with line 122-126) with your new function is_real_nic","commit_id":"79741e6103ca22d5475387bb11323bc34f55c5a0"},{"author":{"_account_id":21151,"name":"zenghui.shi","email":"zshi@redhat.com","username":"zshi"},"change_message_id":"6be81305829f2d49a3a9a6ecd50e5d0efe4716f0","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"def _is_available_nic(interface_name, check_active\u003dTrue):"},{"line_number":107,"context_line":"    try:"},{"line_number":108,"context_line":"        if interface_name \u003d\u003d \u0027lo\u0027:"},{"line_number":109,"context_line":"            return False"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        device_dir \u003d _SYS_CLASS_NET + \u0027/%s/device\u0027 % interface_name"},{"line_number":112,"context_line":"        has_device_dir \u003d os.path.isdir(device_dir)"},{"line_number":113,"context_line":"        if not has_device_dir:"},{"line_number":114,"context_line":"            return False"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        operstate \u003d None"},{"line_number":117,"context_line":"        with open(_SYS_CLASS_NET + \u0027/%s/operstate\u0027 % interface_name, \u0027r\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f436f4f_8af1b104","line":114,"range":{"start_line":108,"start_character":2,"end_line":114,"end_character":24},"in_reply_to":"9f436f4f_91d0cf55","updated":"2017-08-18 02:30:40.000000000","message":"the handling of \u0027lo\u0027 interface is different in is_real_nic and _is_available_nic, so I just replace the checking of device_dir \u0026 address with is_real_nic and leave \u0027lo\u0027 code in _is_available_nic before is_real_nic.  so if the interface_name is \u0027lo\u0027, _is_available_nic will return immediately without executing is_real_nic and keep the \u0027lo\u0027 handling the same as before.","commit_id":"79741e6103ca22d5475387bb11323bc34f55c5a0"}]}
