Merge "Replace basestring by six.string_types"

This commit is contained in:
Jenkins 2014-01-24 07:00:06 +00:00 committed by Gerrit Code Review
commit e3d686f39a
3 changed files with 5 additions and 4 deletions
novaclient

@ -461,7 +461,8 @@ class ShellTest(utils.TestCase):
)
def test_boot_hints(self):
self.run_command('boot --image 1 --flavor 1 --hint a=b=c some-server ')
self.run_command('boot --image 1 --flavor 1 '
'--hint a=b0=c0 --hint a=b1=c1 some-server ')
self.assert_called_anytime(
'POST', '/servers',
{
@ -472,7 +473,7 @@ class ShellTest(utils.TestCase):
'min_count': 1,
'max_count': 1,
},
'os:scheduler_hints': {'a': 'b=c'},
'os:scheduler_hints': {'a': ['b0=c0', 'b1=c1']},
},
)

@ -256,7 +256,7 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
# NOTE(vish): multiple copies of the same hint will
# result in a list of values
if key in hints:
if isinstance(hints[key], basestring):
if isinstance(hints[key], six.string_types):
hints[key] = [hints[key]]
hints[key] += [value]
else:

@ -173,7 +173,7 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
# NOTE(vish): multiple copies of the same hint will
# result in a list of values
if key in hints:
if isinstance(hints[key], basestring):
if isinstance(hints[key], six.string_types):
hints[key] = [hints[key]]
hints[key] += [value]
else: