On Wed, 2010-03-24 at 15:54 +0100, [email protected] wrote:
> ---
>  server/bin/deltacloudd |   28 +++++++++++++++++++---------
>  1 files changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/server/bin/deltacloudd b/server/bin/deltacloudd
> index a1c8f09..eda5c1b 100755
> --- a/server/bin/deltacloudd
> +++ b/server/bin/deltacloudd
> @@ -27,6 +27,7 @@ BANNER
>    end
>    opts.on( '-e', '--env ENV', 'Environment (default: "development")') { 
> |env| options[:env] = env }
>    opts.on( '-h', '--help', '') { options[:help] = true }
> +  opts.on( '-d', '--daemon', 'Run in background') { options[:daemon] = true }
>  end
>  
>  optparse.parse!
> @@ -46,14 +47,26 @@ ENV["API_PORT"] = "3001" unless ENV["API_PORT"]
>  
>  dirname="#{File.dirname(__FILE__)}/.."
>  
> +unless File.exists?(File.join(dirname, "config.ru"))
> + dirname = "/usr/share/deltacloud-core" if 
> File.exists?("/usr/share/deltacloud-core/config.ru")
> +end

Why even worry about /usr/share/deltacloud-core ? With that, we
introduce a difference between gem and rpm installs that isn't really
necessary, and can only lead to trouble (like the above)

I'd just assume that deltacloud-core is always run out of its gem
location, so that you always know how to get to config.ru from
deltacloudd.

> +
>  argv_opts = ARGV.clone
>  argv_opts << ['start'] unless Thin::Runner.commands.include?(options[0])
>  argv_opts << ['--address', ENV["API_HOST"] ]
>  argv_opts << ['--port', ENV["API_PORT"] ]
> -argv_opts << ['--rackup', 'config.ru' ]
> +argv_opts << ['--rackup', "config.ru"]

Doesn't that need to take dirname into account ?

David


_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to