On 09/29/11 - 11:49:08AM, Ian Main wrote:
> This patch updates the condor driver to use UUIDTools as this already
> exists in fedora.  I also added the dependency to the gem list.  The RPM
> will have to be updated for this dependency as well.
> 
> Signed-off-by: Ian Main <im...@redhat.com>
> ---
>  server/deltacloud-core.gemspec                     |    1 +
>  .../lib/deltacloud/drivers/condor/condor_driver.rb |    4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/server/deltacloud-core.gemspec b/server/deltacloud-core.gemspec
> index 1c06542..0fec7c6 100644
> --- a/server/deltacloud-core.gemspec
> +++ b/server/deltacloud-core.gemspec
> @@ -74,6 +74,7 @@ Gem::Specification.new do |s|
>    s.add_dependency('net-ssh', '>= 2.0.0')
>    s.add_dependency('thin', '>= 1.2.5')
>    s.add_dependency('nokogiri', '>= 1.4.3')
> +  s.add_dependency('uuidtools', '>= 2.1.1')

The code itself looks fine.

Slow and I talked on IRC, and agreed that the gemspec needs a comment stating
that it is a dependency for condor-cloud.  The dependency for rest-client also
needs to be updated to mention condor-cloud.

Finally, the RPM needs to be updated to re-enable condor-cloud now that the
dependency has been satisfied.  Therefore, I've committed this patch with some
tweaks.  The patch I pushed looks like the attached.

-- 
Chris Lalancette
>From 8f50da71c64e77d56ad56ee5ba6fd856310939e8 Mon Sep 17 00:00:00 2001
From: Ian Main <im...@redhat.com>
Date: Thu, 29 Sep 2011 11:49:08 -0700
Subject: [PATCH] Use UUIDTools instead of UUID in condor driver

This patch updates the condor driver to use UUIDTools as this already
exists in fedora.  I also added the dependency to the gem list.  The RPM
will have to be updated for this dependency as well.

Signed-off-by: Ian Main <im...@redhat.com>
---
 server/deltacloud-core.gemspec                     |    5 +-
 .../lib/deltacloud/drivers/condor/condor_driver.rb |    4 +-
 server/support/fedora/deltacloud-core.spec         |   61 +++++++-------------
 3 files changed, 28 insertions(+), 42 deletions(-)

diff --git a/server/deltacloud-core.gemspec b/server/deltacloud-core.gemspec
index 1c06542..6a4ae3c 100644
--- a/server/deltacloud-core.gemspec
+++ b/server/deltacloud-core.gemspec
@@ -89,7 +89,10 @@ Gem::Specification.new do |s|
   s.add_dependency('fog')
   s.add_dependency('excon')
 
-# Rhevm
+# Rhevm and Condor Cloud
   s.add_dependency('rest-client')
 
+# Condor Cloud
+  s.add_dependency('uuidtools', '>= 2.1.1')
+
 end
diff --git a/server/lib/deltacloud/drivers/condor/condor_driver.rb 
b/server/lib/deltacloud/drivers/condor/condor_driver.rb
index 7a61bde..ad444d5 100644
--- a/server/lib/deltacloud/drivers/condor/condor_driver.rb
+++ b/server/lib/deltacloud/drivers/condor/condor_driver.rb
@@ -36,7 +36,7 @@ module Deltacloud
     module Condor
 
       require 'base64'
-      require 'uuid'
+      require 'uuidtools'
       require 'fileutils'
 
       class CondorDriver < Deltacloud::BaseDriver
@@ -139,7 +139,7 @@ module Deltacloud
               config_server_address = nil
             end
           end
-          vm_uuid ||= UUID::new.generate
+          vm_uuid ||= UUIDTools::UUID.random_create.to_s
           vm_otp ||= vm_uuid[0..7]
           new_client(credentials) do |condor|
             config_server_address ||= condor.ip_agent.address
diff --git a/server/support/fedora/deltacloud-core.spec 
b/server/support/fedora/deltacloud-core.spec
index ebfe076..0a7cba8 100644
--- a/server/support/fedora/deltacloud-core.spec
+++ b/server/support/fedora/deltacloud-core.spec
@@ -3,7 +3,7 @@
 Summary: Deltacloud REST API
 Name: deltacloud-core
 Version: 0.4.0
-Release: 2%{?dist}
+Release: 4%{?dist}
 Group: Development/Languages
 License: ASL 2.0 and MIT
 URL: http://incubator.apache.org/deltacloud
@@ -59,7 +59,7 @@ Documentation for %{name}
 Summary: Deltacloud Core with all drivers
 Requires: %{name} = %{version}-%{release}
 #Requires: %{name}-azure = %{version}-%{release}
-#Requires: %{name}-condor = %{version}-%{release}
+Requires: %{name}-condor = %{version}-%{release}
 Requires: %{name}-ec2 = %{version}-%{release}
 Requires: %{name}-eucalyptus = %{version}-%{release}
 Requires: %{name}-gogrid = %{version}-%{release}
@@ -85,18 +85,17 @@ Deltacloud core with all available drivers
 #The azure sub-package brings in all dependencies necessary to use deltacloud
 #core to connect to Azure.
 
-# FIXME: the required packages are not yet in Fedora, so disable condor for now
-#% package condor
-#Summary: Deltacloud Core for CondorCloud
-#Requires: %{name} = %{version}-%{release}
-#Requires: rubygem(uuid)
-#Requires: rubygem(rest-client)
-#Requires: condor >= 7.4.0
-#Requires: condor-vm-gahp >= 7.4.0
+%package condor
+Summary: Deltacloud Core for CondorCloud
+Requires: %{name} = %{version}-%{release}
+Requires: rubygem(uuidtools)
+Requires: rubygem(rest-client)
+Requires: condor >= 7.4.0
+Requires: condor-vm-gahp >= 7.4.0
 
-#% description condor
-#The condor sub-package brings in all dependencies necessary to use deltacloud 
core
-#to connect to CondorCloud.
+%description condor
+The condor sub-package brings in all dependencies necessary to use deltacloud 
core
+to connect to CondorCloud.
 
 %package ec2
 Summary: Deltacloud Core for EC2
@@ -208,28 +207,20 @@ find %{buildroot}%{app_root}/lib -type f | xargs chmod -x
 chmod -x %{buildroot}%{_sysconfdir}/sysconfig/%{name}
 chmod 0755 %{buildroot}%{_initddir}/%{name}
 chmod 0755 %{buildroot}%{app_root}/bin/deltacloudd
-rm -rf %{buildroot}%{app_root}/support
 
 # temporarily remove Azure drivers until all dependencies will be pushed in to 
Fedora
 rm -rf %{buildroot}%{app_root}/config/drivers/azure.yaml
 
-# temporarily remove condor support files until we enable condor
-rm -f %{buildroot}%{app_root}/config/addresses.xml
-rm -f %{buildroot}%{app_root}/config/condor.yaml
-rm -f %{buildroot}%{app_root}/config/drivers/condor.yaml
-
 rdoc --op %{buildroot}%{_defaultdocdir}/%{name}
 
 mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
 
-#% install condor
-#install -m 0655 %{buildroot}%{app_root}/support/condor/config/condor-cloud \
-#  %{buildroot}%{_sysconfdir}/sysconfig/condor-cloud
-#install -m 0655 %{buildroot}%{app_root}/support/condor/config/50* \
-#  %{buildroot}%{_sysconfdir}/condor/config.d
-#install -m 0755 %{buildroot}%{app_root}/support/condor/bash/* \
-#  %{buildroot}%{_libexecdir}/condor
-#rm -rf %{buildroot}%{app_root}/support/condor
+# the condor stuff is provided by the condor-cloud package; it really doesn't
+# belong in deltacloud, but until it is removed from upstream we just manually
+# delete it here
+rm -rf %{buildroot}%{app_root}/support/condor
+
+rm -rf %{buildroot}%{app_root}/support/fedora
 
 %check
 pushd %{buildroot}%{app_root}
@@ -287,18 +278,10 @@ fi
 
 #%files azure
 
-#%files condor
-#%{app_root}/config/drivers/condor.yaml
-#%{app_root}/config/condor.yaml
-#%{app_root}/config/addresses.xml
-#%%config(noreplace) %{_sysconfdir}/sysconfig/condor-cloud
-#%%config(noreplace) %{_sysconfdir}/condor/config.d/50condor_cloud.config
-#%%config(noreplace) %{_sysconfdir}/condor/config.d/50condor_cloud_node.config
-#%{_libexecdir}/condor/cached_images.sh
-#%{_libexecdir}/condor/cloud_exit_hook.sh
-#%{_libexecdir}/condor/cloud_functions
-#%{_libexecdir}/condor/cloud_prepare_hook.sh
-#%{_libexecdir}/condor/libvirt_cloud_script.sh
+%files condor
+%{app_root}/config/drivers/condor.yaml
+%{app_root}/config/condor.yaml
+%{app_root}/config/addresses.xml
 
 %files ec2
 %{app_root}/config/drivers/ec2.yaml
-- 
1.7.4.4

Reply via email to