[node-patches] Change in ovirt-node[node-3.0]: network: Remove biosdevname conversion code

fabiand at fedoraproject.org fabiand at fedoraproject.org
Wed Mar 5 11:27:16 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: network: Remove biosdevname conversion code
......................................................................

network: Remove biosdevname conversion code

In the beginning of biosdevname, affected NICs names had to be
converted from their "old" name to the "new" biosdevname name.

But as biosdevname is out of the door for a long itme, we can drop that
code path.

A note on RHEV-H: Only upgrades from the previously released version are
supported, that menas we don't need to support an upgrade from 6.3 to
6.5.

Change-Id: I780dd0770d9f43be6ca0882341bb9fa97d179f96
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1065256
Signed-off-by: Fabian Deutsch <fabiand at redhat.com>
---
M scripts/ovirt-init-functions.sh.in
M src/ovirtnode/network.py
2 files changed, 1 insertion(+), 68 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/95/25395/1

diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index 8e7f185..4608954 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -855,11 +855,7 @@
     # mount /config unless firstboot is forced
     if [ "$firstboot" != "1" ]; then
         mount_config
-        # convert ethX to biosdevnames before mounting config files
-        python <<EOP
-from ovirtnode.network import convert_to_biosdevname
-convert_to_biosdevname()
-EOP
+
         # Trigger mounting so logfiles are visible
         if [[ -e "/bin/systemctl" ]];
         then
diff --git a/src/ovirtnode/network.py b/src/ovirtnode/network.py
index 1dc3ed6..39fc0dc 100644
--- a/src/ovirtnode/network.py
+++ b/src/ovirtnode/network.py
@@ -51,69 +51,6 @@
         return Nameservers().commit()
 
 
-def convert_to_biosdevname():
-    try:
-        import ovirtnode.ovirtfunctions as _functions
-    except:
-        pass
-
-    OVIRT_VARS = _functions.parse_defaults()
-    if not "BIOSDEVNAMES_CONVERSION" in OVIRT_VARS:
-        # check for appropriate bios version
-        cmd="dmidecode|grep SMBIOS|awk {'print $2'}"
-        proc = _functions.passthrough(cmd, log_func=logger.debug)
-        ver = proc.stdout.split()[0]
-        if not float(ver) >= 2.6:
-            logger.debug("Skipping biosdevname conversion, SMBIOS too old")
-            _functions.augtool("set", "/files/etc/default/ovirt/BIOSDEVNAMES_CONVERSION", "y")
-            return
-        nics = {}
-        cmd = "biosdevname -d"
-        biosdevname, err = subprocess.Popen(cmd, shell=True,
-                                          stdout=subprocess.PIPE).communicate()
-        biosdevname_output = biosdevname.splitlines()
-
-        for line in biosdevname_output:
-            if line is not None:
-                if "BIOS device:" in line:
-                    nic = line.split()[2]
-                if "Permanent" in line:
-                    mac = line.split()[2]
-                    nics[mac.upper()] = nic
-        logger.debug(nics)
-        scripts_path = "/etc/sysconfig/network-scripts"
-        logger.debug(glob(scripts_path + "/ifcfg-*"))
-        for file in glob(scripts_path + "/ifcfg-*"):
-            logger.debug("Processing %s" % file)
-            # get mac for matching
-            existing_mac = _functions.augtool_get("/files/" + file + "/HWADDR")
-            if not existing_mac is None:
-                existing_mac = existing_mac.strip('\"')
-            # check dictionary for mac
-            if not existing_mac is None and existing_mac.upper() in nics:
-                old_nic_script = os.path.basename(file)
-                new_nic_name = nics[existing_mac.upper()]
-                logger.debug("Found %s in %s" % (existing_mac, file))
-                # change device name within script file
-                logger.debug("Setting to new device name: %s" % new_nic_name)
-                _functions.augtool("set", \
-                                   "/files" + file + "/DEVICE", new_nic_name)
-                new_nic_file = "%s/ifcfg-%s" % (scripts_path, new_nic_name)
-                cmd = "cp %s %s" % (file, new_nic_file)
-                _functions.remove_config(file)
-                if _functions.system(cmd):
-                    logging.debug("Conversion on %s to %s succeed" % (file,
-                                  new_nic_file))
-                    _functions.ovirt_store_config(new_nic_file)
-                else:
-                    return False
-        _functions.system("service network restart")
-        _functions.augtool("set", \
-                       "/files/etc/default/ovirt/BIOSDEVNAMES_CONVERSION", "y")
-        _functions.ovirt_store_config("/etc/default/ovirt")
-    return True
-
-
 class SetDefaultBootproto(Transaction.Element):
     title = "Setting DHCP"
 


-- 
To view, visit http://gerrit.ovirt.org/25395
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I780dd0770d9f43be6ca0882341bb9fa97d179f96
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: node-3.0
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list