Support Python 3 using six
This commit is contained in:
parent
d653a3a3f7
commit
eedb4c4b73
67 changed files with 455 additions and 255 deletions
|
|
@ -1,15 +1,16 @@
|
|||
from __future__ import unicode_literals
|
||||
import random
|
||||
import string
|
||||
import six
|
||||
|
||||
|
||||
def random_job_id(size=13):
|
||||
chars = range(10) + list(string.uppercase)
|
||||
job_tag = ''.join(unicode(random.choice(chars)) for x in range(size))
|
||||
chars = list(range(10)) + list(string.ascii_uppercase)
|
||||
job_tag = ''.join(six.text_type(random.choice(chars)) for x in range(size))
|
||||
return 'j-{0}'.format(job_tag)
|
||||
|
||||
|
||||
def random_instance_group_id(size=13):
|
||||
chars = range(10) + list(string.uppercase)
|
||||
job_tag = ''.join(unicode(random.choice(chars)) for x in range(size))
|
||||
chars = list(range(10)) + list(string.ascii_uppercase)
|
||||
job_tag = ''.join(six.text_type(random.choice(chars)) for x in range(size))
|
||||
return 'i-{0}'.format(job_tag)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue