From 102dd2aa3b73cd5936dd44b4aa0f22fc12ab1ce0 Mon Sep 17 00:00:00 2001 From: ahrenholz Date: Mon, 28 Oct 2013 14:33:31 +0000 Subject: [PATCH] set NODE_NAME and NODE_NUMBER in default vnoded environment for SimpleLxcNodes (Boeing r1788) --- daemon/core/netns/vnode.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/daemon/core/netns/vnode.py b/daemon/core/netns/vnode.py index 4c59b114..3cf49395 100644 --- a/daemon/core/netns/vnode.py +++ b/daemon/core/netns/vnode.py @@ -55,9 +55,12 @@ class SimpleLxcNode(PyCoreNode): "-p", self.ctrlchnlname + ".pid"] if 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: - tmp = subprocess.Popen(vnoded, stdout = subprocess.PIPE, - env = self.session.getenviron(state=False)) + tmp = subprocess.Popen(vnoded, stdout = subprocess.PIPE, env = env) except OSError, e: msg = "error running vnoded command: %s (%s)" % (vnoded, e) self.exception(coreapi.CORE_EXCP_LEVEL_FATAL,