mirror of https://github.com/OpenKMIP/PyKMIP.git
flake8 fix
This commit is contained in:
parent
e67f56ae56
commit
6752b700c9
|
@ -92,15 +92,15 @@ class Name(Struct):
|
|||
not isinstance(self.name_value, str):
|
||||
member = 'name_value'
|
||||
raise TypeError(msg.format('{}.{}'.format(name, member),
|
||||
'name_value', type(Name.NameValue),
|
||||
type(self.name_value)))
|
||||
'name_value', type(Name.NameValue),
|
||||
type(self.name_value)))
|
||||
if self.name_type and \
|
||||
not isinstance(self.name_type, Name.NameType) and \
|
||||
not isinstance(self.name_type, str):
|
||||
member = 'name_type'
|
||||
raise TypeError(msg.format('{}.{}'.format(name, member),
|
||||
'name_type', type(Name.NameType),
|
||||
type(self.name_type)))
|
||||
'name_type', type(Name.NameType),
|
||||
type(self.name_type)))
|
||||
|
||||
@classmethod
|
||||
def create(cls, name_value, name_type):
|
||||
|
@ -109,24 +109,24 @@ class Name(Struct):
|
|||
elif isinstance(name_value, str):
|
||||
value = cls.NameValue(name_value)
|
||||
else:
|
||||
name = self.__class__.__name__
|
||||
name = 'Name'
|
||||
msg = ErrorStrings.BAD_EXP_RECV
|
||||
member = 'name_value'
|
||||
raise TypeError(msg.format('{}.{}'.format(name, member),
|
||||
'name_value', type(Name.NameValue),
|
||||
type(self.name_value)))
|
||||
'name_value', type(Name.NameValue),
|
||||
type(name_value)))
|
||||
|
||||
if isinstance(name_type, Name.NameType):
|
||||
n_type = name_type
|
||||
elif isinstance(name_type, Enum):
|
||||
n_type = cls.NameType(name_type)
|
||||
else:
|
||||
name = self.__class__.__name__
|
||||
name = 'Name'
|
||||
msg = ErrorStrings.BAD_EXP_RECV
|
||||
member = 'name_type'
|
||||
raise TypeError(msg.format('{}.{}'.format(name, member),
|
||||
'name_type', type(Name.NameType),
|
||||
type(self.name_type)))
|
||||
'name_type', type(Name.NameType),
|
||||
type(name_type)))
|
||||
|
||||
return Name(name_value=value,
|
||||
name_type=n_type)
|
||||
|
|
Loading…
Reference in New Issue