set NODE_NAME and NODE_NUMBER in default vnoded environment for SimpleLxcNodes

(Boeing r1788)
This commit is contained in:
ahrenholz 2013-10-28 14:33:31 +00:00
parent b6f4e035c2
commit 102dd2aa3b

View file

@ -55,9 +55,12 @@ class SimpleLxcNode(PyCoreNode):
"-p", self.ctrlchnlname + ".pid"] "-p", self.ctrlchnlname + ".pid"]
if self.nodedir: if self.nodedir:
vnoded += ["-C", self.nodedir] vnoded += ["-C", self.nodedir]
env = self.session.getenviron(state=False)
env['NODE_NUMBER'] = str(self.objid)
env['NODE_NAME'] = str(self.name)
try: try:
tmp = subprocess.Popen(vnoded, stdout = subprocess.PIPE, tmp = subprocess.Popen(vnoded, stdout = subprocess.PIPE, env = env)
env = self.session.getenviron(state=False))
except OSError, e: except OSError, e:
msg = "error running vnoded command: %s (%s)" % (vnoded, e) msg = "error running vnoded command: %s (%s)" % (vnoded, e)
self.exception(coreapi.CORE_EXCP_LEVEL_FATAL, self.exception(coreapi.CORE_EXCP_LEVEL_FATAL,