X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Fapplication.py;h=080c3a402ceed83eb1731ca7b8d90c819b6997cf;hb=62a8f5c90afe9033f532206c811cff8ea76b2c09;hp=b269e80e95891046ccc63dbf893e31c2a5d55a8f;hpb=414330e13af67326e28650bfcac99459799f8a62;p=nepi.git
diff --git a/src/nepi/resources/linux/application.py b/src/nepi/resources/linux/application.py
index b269e80e..080c3a40 100644
--- a/src/nepi/resources/linux/application.py
+++ b/src/nepi/resources/linux/application.py
@@ -1,21 +1,21 @@
-"""
- NEPI, a framework to manage network experiments
- Copyright (C) 2013 INRIA
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-"""
+#
+# NEPI, a framework to manage network experiments
+# Copyright (C) 2013 INRIA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+# Author: Alina Quereilhac
from nepi.execution.attribute import Attribute, Flags, Types
from nepi.execution.trace import Trace, TraceAttr
@@ -29,7 +29,8 @@ import os
reschedule_delay = "0.5s"
state_check_delay = 1
-# TODO: Resolve wildcards in commands!!
+# TODO: Resolve wildcards in commands!!
+# TODO: If command is not set give a warning but do not generate an error!
@clsinit
class LinuxApplication(ResourceManager):
@@ -221,9 +222,9 @@ class LinuxApplication(ResourceManager):
# Export environment
environ = ""
- env = self.get("env") or ""
- for var in env.split(" "):
- environ += 'export %s\n' % var
+ if self.get("env"):
+ for var in self.get("env").split(" "):
+ environ += 'export %s\n' % var
command = environ + command