Juan Hernandez has uploaded a new change for review.

Change subject: packaging: Export ENGINE_DEFAULTS and ENGINE_VARS
......................................................................

packaging: Export ENGINE_DEFAULTS and ENGINE_VARS

The start scripts for the engine and for the tools don't export the
ENGINE_DEFAULTS and ENGINE_VARS environment variables. This means that
the LocalConfig class won't use its value to locate the configuration.

Change-Id: I6a41287040260eb43272c0b15af0b93eba585675
Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com>
---
M backend/manager/tools/engine-tools-common/src/main/shell/engine-prolog.sh.in
M packaging/fedora/engine-service.py.in
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/60/11160/1

diff --git 
a/backend/manager/tools/engine-tools-common/src/main/shell/engine-prolog.sh.in 
b/backend/manager/tools/engine-tools-common/src/main/shell/engine-prolog.sh.in
index bc76576..de140f5 100644
--- 
a/backend/manager/tools/engine-tools-common/src/main/shell/engine-prolog.sh.in
+++ 
b/backend/manager/tools/engine-tools-common/src/main/shell/engine-prolog.sh.in
@@ -7,6 +7,7 @@
 load_config() {
     # Load the defaults file:
     ENGINE_DEFAULTS="${ENGINE_DEFAULTS:-@ENGINE_DEFAULTS@}"
+    export ENGINE_DEFAULTS
     if [ ! -r "${ENGINE_DEFAULTS}" ]
     then
         die "Can't load defaults file \"${ENGINE_DEFAULTS}\"."
@@ -15,6 +16,7 @@
 
     # Load the configuration file:
     ENGINE_VARS="${ENGINE_VARS:-@ENGINE_VARS@}"
+    export ENGINE_VARS
     if [ ! -r "${ENGINE_VARS}" ]
     then
         die "Can't load configuration file \"${ENGINE_VARS}\"."
diff --git a/packaging/fedora/engine-service.py.in 
b/packaging/fedora/engine-service.py.in
index 278bc25..1b9ab08 100644
--- a/packaging/fedora/engine-service.py.in
+++ b/packaging/fedora/engine-service.py.in
@@ -44,6 +44,8 @@
 engineName = "engine-service"
 
 # The engine system configuration variables:
+engineDefaultsFile = None
+engineConfigFile = None
 engineConfig = None
 
 # The name of the user and group that should run the service:
@@ -78,8 +80,6 @@
 
 # Engine files:
 enginePidFile = None
-engineConfigTemplateFile = None
-engineConfigFile = None
 engineLogFile = None
 engineConsoleLogFile = None
 engineServerLogFile = None
@@ -120,11 +120,13 @@
 
 def loadConfig():
     # Locate the defaults file:
+    global engineDefaultsFile
     engineDefaultsFile = os.getenv("ENGINE_DEFAULTS", "@ENGINE_DEFAULTS@")
     if not os.path.exists(engineDefaultsFile):
         raise Exception("The engine configuration defaults file \"%s\" doesn't 
exist." % engineDefaultsFile)
 
     # Locate the configuration file:
+    global engineConfigFile
     engineConfigFile = os.getenv("ENGINE_VARS", "@ENGINE_VARS@")
     if not os.path.exists(engineConfigFile):
         raise Exception("The engine configuration file \"%s\" doesn't exist." 
% engineConfigFile)
@@ -530,6 +532,8 @@
     engineEnv = {
         "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin",
         "LANG": "en_US.UTF-8",
+        "ENGINE_DEFAULTS": engineDefaultsFile,
+        "ENGINE_VARS": engineConfigFile,
         "ENGINE_ETC": engineEtcDir,
         "ENGINE_LOG": engineLogDir,
         "ENGINE_TMP": engineTmpDir,


--
To view, visit http://gerrit.ovirt.org/11160
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a41287040260eb43272c0b15af0b93eba585675
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to