diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-04-21 12:51:13 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-04-21 12:51:13 +0100 |
commit | c64f368519d5cb424e54f22d3b3d1abd5c169762 (patch) | |
tree | be98458e8021fbd35f41884ca3636b7c2dca1733 /tools/xm-test/lib/XmTestLib/NetConfig.py | |
parent | 832656a1796170a11fc72035cae542a383a8843c (diff) | |
download | xen-c64f368519d5cb424e54f22d3b3d1abd5c169762.tar.gz xen-c64f368519d5cb424e54f22d3b3d1abd5c169762.tar.bz2 xen-c64f368519d5cb424e54f22d3b3d1abd5c169762.zip |
cpupools [5/6]: xm-test add-ons
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Diffstat (limited to 'tools/xm-test/lib/XmTestLib/NetConfig.py')
-rw-r--r-- | tools/xm-test/lib/XmTestLib/NetConfig.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tools/xm-test/lib/XmTestLib/NetConfig.py b/tools/xm-test/lib/XmTestLib/NetConfig.py index 21be40db48..1f834cc95a 100644 --- a/tools/xm-test/lib/XmTestLib/NetConfig.py +++ b/tools/xm-test/lib/XmTestLib/NetConfig.py @@ -56,17 +56,21 @@ def getXendNetConfig(): val = pin.get_val() while val[0] != 'network-script': val = pin.get_val() - - # split network command into script name and its parameters - sub_val = val[1].split() - if sub_val[0] == "network-bridge": + + if val[0] != 'network-script' or len(val) < 2: + # entry network-script not found or no type specified netenv = "bridge" - elif sub_val[0] == "network-route": - netenv = "route" - elif sub_val[0] == "network-nat": - netenv = "nat" else: - raise NetworkError("Failed to get network env from xend config") + # split network command into script name and its parameters + sub_val = val[1].split() + if sub_val[0] == "network-bridge": + netenv = "bridge" + elif sub_val[0] == "network-route": + netenv = "route" + elif sub_val[0] == "network-nat": + netenv = "nat" + else: + raise NetworkError("Failed to get network env from xend config") configfile.close() return netenv |