Change unicode() --> six.text_type() for Python 3

This commit is contained in:
cclauss
2018-02-08 22:04:08 +01:00
parent 7e42c54868
commit 2e623ad80c
16 changed files with 68 additions and 48 deletions

View File

@@ -1274,7 +1274,7 @@ class InventorySourceOptions(BaseModel):
source_vars_dict = VarsDictProperty('source_vars')
def clean_instance_filters(self):
instance_filters = unicode(self.instance_filters or '')
instance_filters = six.text_type(self.instance_filters or '')
if self.source == 'ec2':
invalid_filters = []
instance_filter_re = re.compile(r'^((tag:.+)|([a-z][a-z\.-]*[a-z]))=.*$')
@@ -1300,7 +1300,7 @@ class InventorySourceOptions(BaseModel):
return ''
def clean_group_by(self):
group_by = unicode(self.group_by or '')
group_by = six.text_type(self.group_by or '')
if self.source == 'ec2':
get_choices = getattr(self, 'get_%s_group_by_choices' % self.source)
valid_choices = [x[0] for x in get_choices()]