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(a)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