You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Ian Main <im...@redhat.com> on 2011/07/27 21:19:53 UTC
[PATCH] A few fixes for condor cloud
This patch fixes two major issues. The confserver code doesn't
interpret as is. Also daemon runs as 'nobody' so we don't need the
'su'.
Signed-off-by: Ian Main <im...@redhat.com>
---
.../lib/deltacloud/drivers/condor/condor_client.rb | 5 +----
.../drivers/condor/ip_agents/confserver.rb | 5 ++---
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/server/lib/deltacloud/drivers/condor/condor_client.rb b/server/lib/deltacloud/drivers/condor/condor_client.rb
index 716e2b7..c962d03 100644
--- a/server/lib/deltacloud/drivers/condor/condor_client.rb
+++ b/server/lib/deltacloud/drivers/condor/condor_client.rb
@@ -38,10 +38,7 @@ module CondorCloud
CONDOR_Q_CMD = ENV['CONDOR_Q_CMD'] || "condor_q"
CONDOR_RM_CMD = ENV['CONDOR_RM_CMD'] || "condor_rm"
-
- # deltacloudd runs as root from the init script so we have to use su to move to
- # 'condor' user.
- CONDOR_SUBMIT_CMD = ENV['CONDOR_SUBMIT_CMD'] || 'su condor -m -c condor_submit'
+ CONDOR_SUBMIT_CMD = ENV['CONDOR_SUBMIT_CMD'] || 'condor_submit'
# This directory needs to be readable for user running Deltacloud API
CONDOR_CONFIG = ENV['CONDOR_CONFIG'] || 'config/condor.yaml'
diff --git a/server/lib/deltacloud/drivers/condor/ip_agents/confserver.rb b/server/lib/deltacloud/drivers/condor/ip_agents/confserver.rb
index 3604360..9854042 100644
--- a/server/lib/deltacloud/drivers/condor/ip_agents/confserver.rb
+++ b/server/lib/deltacloud/drivers/condor/ip_agents/confserver.rb
@@ -47,11 +47,10 @@ module CondorCloud
def find_free_mac
addr_hash = {}
DefaultExecutor::new do |executor|
- CondorAddresses = (@mappings/'/CondorAddresses/CondorAddress').collect { |a| CondorAddress.new(:ip => a.text.strip, :mac => a[:mac]) }
# Make an CondorAddress hash to speed up the inner loop.
- CondorAddresses.each do |CondorAddress|
- addr_hash[CondorAddress.mac] = CondorAddress.ip
+ CondorAddresses.each do |address|
+ addr_hash[address.mac] = address.ip
end
executor.instances.each do |instance|
--
1.7.6
Re: [PATCH] A few fixes for condor cloud
Posted by Michal Fojtik <mf...@redhat.com>.
On Jul 27, 2011, at 9:19 PM, Ian Main wrote:
> This patch fixes two major issues. The confserver code doesn't
> interpret as is. Also daemon runs as 'nobody' so we don't need the
> 'su'.
ACK. Sorry for the second one, I'll try to use s/// in Vim more carefully ;-)
-- Michal
>
> Signed-off-by: Ian Main <im...@redhat.com>
> ---
> .../lib/deltacloud/drivers/condor/condor_client.rb | 5 +----
> .../drivers/condor/ip_agents/confserver.rb | 5 ++---
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/server/lib/deltacloud/drivers/condor/condor_client.rb b/server/lib/deltacloud/drivers/condor/condor_client.rb
> index 716e2b7..c962d03 100644
> --- a/server/lib/deltacloud/drivers/condor/condor_client.rb
> +++ b/server/lib/deltacloud/drivers/condor/condor_client.rb
> @@ -38,10 +38,7 @@ module CondorCloud
>
> CONDOR_Q_CMD = ENV['CONDOR_Q_CMD'] || "condor_q"
> CONDOR_RM_CMD = ENV['CONDOR_RM_CMD'] || "condor_rm"
> -
> - # deltacloudd runs as root from the init script so we have to use su to move to
> - # 'condor' user.
> - CONDOR_SUBMIT_CMD = ENV['CONDOR_SUBMIT_CMD'] || 'su condor -m -c condor_submit'
> + CONDOR_SUBMIT_CMD = ENV['CONDOR_SUBMIT_CMD'] || 'condor_submit'
>
> # This directory needs to be readable for user running Deltacloud API
> CONDOR_CONFIG = ENV['CONDOR_CONFIG'] || 'config/condor.yaml'
> diff --git a/server/lib/deltacloud/drivers/condor/ip_agents/confserver.rb b/server/lib/deltacloud/drivers/condor/ip_agents/confserver.rb
> index 3604360..9854042 100644
> --- a/server/lib/deltacloud/drivers/condor/ip_agents/confserver.rb
> +++ b/server/lib/deltacloud/drivers/condor/ip_agents/confserver.rb
> @@ -47,11 +47,10 @@ module CondorCloud
> def find_free_mac
> addr_hash = {}
> DefaultExecutor::new do |executor|
> - CondorAddresses = (@mappings/'/CondorAddresses/CondorAddress').collect { |a| CondorAddress.new(:ip => a.text.strip, :mac => a[:mac]) }
>
> # Make an CondorAddress hash to speed up the inner loop.
> - CondorAddresses.each do |CondorAddress|
> - addr_hash[CondorAddress.mac] = CondorAddress.ip
> + CondorAddresses.each do |address|
> + addr_hash[address.mac] = address.ip
> end
>
> executor.instances.each do |instance|
> --
> 1.7.6
>
----------------------------------------------------------------------
Michal Fojtik, Senior Software Engineer, Red Hat Czech
mfojtik@redhat.com
Deltacloud API: http://deltacloud.org