boolean logic cleanup in service.Swift[Copy|Post]Object

Change-Id: I07e74536502ec2479b22a825f684703d65924563
This commit is contained in:
Clay Gerrard
2016-05-26 11:17:13 -07:00
committed by Tim Burke
parent 5acefd27e4
commit 96f0031e64

View File

@@ -323,13 +323,12 @@ class SwiftPostObject(object):
specified separately for each individual object. specified separately for each individual object.
""" """
def __init__(self, object_name, options=None): 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( raise SwiftError(
"Object names must be specified as non-empty strings" "Object names must be specified as non-empty strings"
) )
else: self.object_name = object_name
self.object_name = object_name self.options = options
self.options = options
class SwiftCopyObject(object): class SwiftCopyObject(object):
@@ -340,7 +339,7 @@ class SwiftCopyObject(object):
destination and fresh_metadata should be set in options destination and fresh_metadata should be set in options
""" """
def __init__(self, object_name, options=None): 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( raise SwiftError(
"Object names must be specified as non-empty strings" "Object names must be specified as non-empty strings"
) )