From: Joe VLcek <jvlcek(a)redhat.com>
Signed-off-by: Joe VLcek <jvlcek(a)redhat.com>
---
configserver/Rakefile | 6 +++-
configserver/src/config.in.ru | 43 +++++++++++++++++++++++++++++++++++++++++
configserver/src/config.ru | 43 -----------------------------------------
3 files changed, 47 insertions(+), 45 deletions(-)
create mode 100644 configserver/src/config.in.ru
delete mode 100644 configserver/src/config.ru
diff --git a/configserver/Rakefile b/configserver/Rakefile
index b60decb..55c6cf0 100644
--- a/configserver/Rakefile
+++ b/configserver/Rakefile
@@ -30,6 +30,7 @@ pkg_name = 'aeolus-configserver'
SPEC_FILE_IN="aeolus-configserver.spec.in"
SPEC_FILE="aeolus-configserver.spec"
+CONFIG_RU_IN="src/config.in.ru"
CONFIG_RU="src/config.ru"
SETUP="configure/bin/config_httpd.sh"
MAN="aeolus-configserver-setup.8"
@@ -37,7 +38,7 @@ LOGS="log"
GENERATED_FILES=[
[SPEC_FILE_IN,SPEC_FILE,"version",true,nil],
- [CONFIG_RU,CONFIG_RU,"version",true,nil],
+ [CONFIG_RU_IN,CONFIG_RU,"version",true,nil],
[SETUP,MAN,"man",true,nil]
]
@@ -51,13 +52,14 @@ GENERATED_FILES=[
# which would change both the packaged file and the file in the source tree.
configserver_files = FileList[
SPEC_FILE_IN,
+ CONFIG_RU_IN,
"Rakefile", "COPYING",
"schema/*.rng",
"src/**/*.*",
"conf/*",
"client/*",
"configure/**/*",
-].exclude(CONFIG_RU).exclude(LOGS)
+].exclude(LOGS)
spec = Gem::Specification.new do |s|
s.name = pkg_name
diff --git a/configserver/src/config.in.ru b/configserver/src/config.in.ru
new file mode 100644
index 0000000..b74ab3b
--- /dev/null
+++ b/configserver/src/config.in.ru
@@ -0,0 +1,43 @@
+root_dir = File.dirname(__FILE__)
+version = ENV['AEOLUS_CONFSERVER_VERSION'] || '@VERSION@'
+storage_dir = ENV['STORAGE_DIR'] || '/tmp/audrey'
+instance_config_rng = ENV['INSTANCE_CONFIG_RNG'] ||
+ '/var/lib/aeolus-configserver/schema/instance-config.rng'
+
+env = ENV['RACK_ENV'].to_sym
+proxy_type=ENV['PROXY_TYPE']
+# when apache is handling auth
+proxy_auth_file = ENV['PROXY_AUTH_FILE']
+
+require 'configserver'
+set :environment, env
+set :storage_dir, storage_dir
+set :instance_config_rng, instance_config_rng
+set :root, root_dir
+set :version, version
+set :proxy_type, proxy_type
+ConfigServer::Model.storage_dir = settings.storage_dir
+disable :run
+
+require 'logger'
+$LOGGER = Logger.new(ENV['APPLICATION_LOG'])
+if env == :production
+ $LOGGER.level = Logger::INFO
+ set :oauth_ignore_post_body, true
+else
+ $LOGGER.level = Logger::DEBUG
+ require 'ruby-debug'
+ set :oauth_ignore_post_body, false
+end
+
+# This is an awful hack that needs to go away very soon!
+# In order to make this go away, Conductor needs to use
+# the oauth client to post instance config XML instead of
+# using RestClient
+if env == :production
+ set :oauth_ignore_post_body, true
+else
+ set :oauth_ignore_post_body, false
+end
+
+run Sinatra::Application
diff --git a/configserver/src/config.ru b/configserver/src/config.ru
deleted file mode 100644
index b74ab3b..0000000
--- a/configserver/src/config.ru
+++ /dev/null
@@ -1,43 +0,0 @@
-root_dir = File.dirname(__FILE__)
-version = ENV['AEOLUS_CONFSERVER_VERSION'] || '@VERSION@'
-storage_dir = ENV['STORAGE_DIR'] || '/tmp/audrey'
-instance_config_rng = ENV['INSTANCE_CONFIG_RNG'] ||
- '/var/lib/aeolus-configserver/schema/instance-config.rng'
-
-env = ENV['RACK_ENV'].to_sym
-proxy_type=ENV['PROXY_TYPE']
-# when apache is handling auth
-proxy_auth_file = ENV['PROXY_AUTH_FILE']
-
-require 'configserver'
-set :environment, env
-set :storage_dir, storage_dir
-set :instance_config_rng, instance_config_rng
-set :root, root_dir
-set :version, version
-set :proxy_type, proxy_type
-ConfigServer::Model.storage_dir = settings.storage_dir
-disable :run
-
-require 'logger'
-$LOGGER = Logger.new(ENV['APPLICATION_LOG'])
-if env == :production
- $LOGGER.level = Logger::INFO
- set :oauth_ignore_post_body, true
-else
- $LOGGER.level = Logger::DEBUG
- require 'ruby-debug'
- set :oauth_ignore_post_body, false
-end
-
-# This is an awful hack that needs to go away very soon!
-# In order to make this go away, Conductor needs to use
-# the oauth client to post instance config XML instead of
-# using RestClient
-if env == :production
- set :oauth_ignore_post_body, true
-else
- set :oauth_ignore_post_body, false
-end
-
-run Sinatra::Application
--
1.7.6.4