Replace basestring with six.string_types

openstack/heat-templates has the issue but heat-agents was missing it

Change-Id: Id6da9285eeeb12b86164a080271d3f9ba40177dd
This commit is contained in:
Quique Llorente 2018-11-06 12:21:15 +01:00
parent 637e4260ca
commit 73e2125532
1 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,8 @@ import stat
import subprocess import subprocess
import sys import sys
import six
# legacy groups that have never had a hook script # legacy groups that have never had a hook script
WHITELISTED_MISSING_HOOK_SCRIPTS = ['os-apply-config'] WHITELISTED_MISSING_HOOK_SCRIPTS = ['os-apply-config']
HOOKS_DIR_PATHS = ( HOOKS_DIR_PATHS = (
@ -93,7 +95,7 @@ def invoke_hook(c, log):
hot_inputs = c.get('inputs', []) hot_inputs = c.get('inputs', [])
for hot_input in hot_inputs: for hot_input in hot_inputs:
if hot_input.get('type', None) == 'String' and \ if hot_input.get('type', None) == 'String' and \
not isinstance(hot_input['value'], basestring): not isinstance(hot_input['value'], six.string_types):
hot_input['value'] = str(hot_input['value']) hot_input['value'] = str(hot_input['value'])
iv = dict((i['name'], i['value']) for i in c['inputs']) iv = dict((i['name'], i['value']) for i in c['inputs'])
# The group property indicates whether it is softwarecomponent or # The group property indicates whether it is softwarecomponent or