git://git.onelab.eu
/
nodemanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change trigger script name
[nodemanager.git]
/
tools.py
diff --git
a/tools.py
b/tools.py
index
059b282
..
feb3e33
100644
(file)
--- a/
tools.py
+++ b/
tools.py
@@
-242,6
+242,11
@@
def get_sliver_ifconfig(slice_name, device="eth0"):
side effects: adds "/usr/sbin" to sys.path
"""
side effects: adds "/usr/sbin" to sys.path
"""
+ # See if setns is installed. If it's not then we're probably not running
+ # LXC.
+ if not os.path.exists("/usr/sbin/setns.so"):
+ return None
+
# setns is part of lxcsu and is installed to /usr/sbin
if not "/usr/sbin" in sys.path:
sys.path.append("/usr/sbin")
# setns is part of lxcsu and is installed to /usr/sbin
if not "/usr/sbin" in sys.path:
sys.path.append("/usr/sbin")