Change in vdsm[master]: nettestlib: use cpuarch module

mpolednik at redhat.com mpolednik at redhat.com
Mon Dec 7 12:26:25 UTC 2015


Martin Polednik has uploaded a new change for review.

Change subject: nettestlib: use cpuarch module
......................................................................

nettestlib: use cpuarch module

This patch updates the architectural dependant code in nettestlib to
use the new cpuarch module.

Change-Id: Idacb382c2abcbc4e1e7a3d9423b1814b64409ed8
Signed-off-by: Martin Polednik <mpolednik at redhat.com>
---
M tests/nettestlib.py
1 file changed, 4 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/49992/1

diff --git a/tests/nettestlib.py b/tests/nettestlib.py
index eba6ba9..f908755 100644
--- a/tests/nettestlib.py
+++ b/tests/nettestlib.py
@@ -22,7 +22,6 @@
 import functools
 import json
 import os
-import platform
 import signal
 import struct
 import time
@@ -32,6 +31,7 @@
 from nose.plugins.skip import SkipTest
 
 from vdsm.constants import EXT_BRCTL, EXT_TC
+from vdsm import cpuarch
 from vdsm.ipwrapper import (addrAdd, linkSet, linkAdd, linkDel, IPRoute2Error,
                             netns_add, netns_delete, netns_exec)
 from vdsm.netlink import monitor
@@ -154,13 +154,12 @@
 
     _IFF_TAP = 0x0002
     _IFF_NO_PI = 0x1000
-    arch = platform.machine()
-    if arch == 'x86_64':
+    if cpuarch.current() == cpuarch.Architecture.X86_64:
         _TUNSETIFF = 0x400454ca
-    elif arch == 'ppc64':
+    elif cpuarch.current() == cpuarch.Architecture.PPC64:
         _TUNSETIFF = 0x800454ca
     else:
-        raise SkipTest("Unsupported Architecture %s" % arch)
+        raise SkipTest("Unsupported Architecture %s" % cpuarch.current())
 
     _deviceListener = None
 


-- 
To view, visit https://gerrit.ovirt.org/49992
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idacb382c2abcbc4e1e7a3d9423b1814b64409ed8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik at redhat.com>


More information about the vdsm-patches mailing list