diff options
author | Clay Gerrard <clay.gerrard@gmail.com> | 2016-05-26 11:17:13 -0700 |
---|---|---|
committer | Tim Burke <tim.burke@gmail.com> | 2016-08-25 13:15:44 -0700 |
commit | 96f0031e642081fabfcda19f2fbc66b86e97339e (patch) | |
tree | 6c1d773d59a7dce0142cbb0f7e0c169e46dba652 /swiftclient | |
parent | 5acefd27e4e4de01414cc67f6652cc946b51957b (diff) | |
download | python-swiftclient-96f0031e642081fabfcda19f2fbc66b86e97339e.tar.gz |
boolean logic cleanup in service.Swift[Copy|Post]Object
Change-Id: I07e74536502ec2479b22a825f684703d65924563
Diffstat (limited to 'swiftclient')
-rw-r--r-- | swiftclient/service.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/swiftclient/service.py b/swiftclient/service.py index 0c16262..f204895 100644 --- a/swiftclient/service.py +++ b/swiftclient/service.py @@ -323,13 +323,12 @@ class SwiftPostObject(object): specified separately for each individual object. """ def __init__(self, object_name, options=None): - if not isinstance(object_name, string_types) or not object_name: + if not (isinstance(object_name, string_types) and object_name): raise SwiftError( "Object names must be specified as non-empty strings" ) - else: - self.object_name = object_name - self.options = options + self.object_name = object_name + self.options = options class SwiftCopyObject(object): @@ -340,7 +339,7 @@ class SwiftCopyObject(object): destination and fresh_metadata should be set in options """ def __init__(self, object_name, options=None): - if not isinstance(object_name, string_types) or not object_name: + if not (isinstance(object_name, string_types) and object_name): raise SwiftError( "Object names must be specified as non-empty strings" ) |