Just a couple of small fixes for the factory, pointed out by Padraig Brady.
As pointed out by Padraig Brady, we can simplify the code by just calling url.rstrip('/') instead of having a conditional.
Signed-off-by: Chris Lalancette clalance@redhat.com --- imgfac/ImageWarehouse.py | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/imgfac/ImageWarehouse.py b/imgfac/ImageWarehouse.py index 4277fb1..b134f6e 100644 --- a/imgfac/ImageWarehouse.py +++ b/imgfac/ImageWarehouse.py @@ -57,10 +57,7 @@ class ImageWarehouse(object): self.icicle_bucket = ApplicationConfiguration().configuration['icicle_bucket'] self.provider_image_bucket = ApplicationConfiguration().configuration['provider_bucket']
- if (url.endswith('/')): - self.url = url[0:len(url)-1] - else: - self.url = url + self.url = url.rstrip('/')
self.log.debug("Created Image Warehouse instance %s" % (self, ))
ACK
On Aug 26, 2011, at 11:17 AM, Chris Lalancette wrote:
As pointed out by Padraig Brady, we can simplify the code by just calling url.rstrip('/') instead of having a conditional.
Signed-off-by: Chris Lalancette clalance@redhat.com
imgfac/ImageWarehouse.py | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/imgfac/ImageWarehouse.py b/imgfac/ImageWarehouse.py index 4277fb1..b134f6e 100644 --- a/imgfac/ImageWarehouse.py +++ b/imgfac/ImageWarehouse.py @@ -57,10 +57,7 @@ class ImageWarehouse(object): self.icicle_bucket = ApplicationConfiguration().configuration['icicle_bucket'] self.provider_image_bucket = ApplicationConfiguration().configuration['provider_bucket']
if (url.endswith('/')):
self.url = url[0:len(url)-1]
else:
self.url = url
self.url = url.rstrip('/') self.log.debug("Created Image Warehouse instance %s" % (self, ))
-- 1.7.4.4
aeolus-devel mailing list aeolus-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/aeolus-devel
That way we get sparse files, which is good.
Signed-off-by: Chris Lalancette clalance@redhat.com --- imgfac/builders/Fedora_condorcloud_Builder.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/imgfac/builders/Fedora_condorcloud_Builder.py b/imgfac/builders/Fedora_condorcloud_Builder.py index ca222a8..4a9378a 100644 --- a/imgfac/builders/Fedora_condorcloud_Builder.py +++ b/imgfac/builders/Fedora_condorcloud_Builder.py @@ -17,7 +17,7 @@ import zope import oz.GuestFactory import oz.TDL import os -import shutil +import oz.ozutil import guestfs import traceback import pycurl @@ -193,7 +193,7 @@ class Fedora_condorcloud_Builder(BaseBuilder): # Copy to staging location # The os-native cp command in Fedora and RHEL does sparse file detection which is good self.log.debug("Copying (%s) to (%s)" % (input_image, staging_image)) - shutil.copyfile(input_image, staging_image) + oz.ozutil.copyfile_sparse(input_image, staging_image)
# Retrieve original XML and write it out to the final dir image_xml_base="/condorimage-" + self.new_image_id + ".xml"
aeolus-devel@lists.fedorahosted.org