more robust get_node_virt
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 8 Jul 2013 19:37:37 +0000 (21:37 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 8 Jul 2013 19:37:37 +0000 (21:37 +0200)
tools.py

index 4cbfa3b..a53c158 100644 (file)
--- a/tools.py
+++ b/tools.py
@@ -300,10 +300,10 @@ def get_node_virt ():
     except:
         pass
     logger.log("Computing virt..")
-    vs_retcod=subprocess.call ([ 'vserver', '--help' ])
-    if vs_retcod == 0:
-        virt='vs'
-    else:
+    try: 
+        if subprocess.call ([ 'vserver', '--help' ]) ==0: virt='vs'
+        else:                                             virt='lxc'      
+    except:
         virt='lxc'
     with file(virt_stamp,"w") as f:
         f.write(virt)