moto/moto/emr/utils.py

17 lines
498 B
Python
Raw Normal View History

from __future__ import unicode_literals
2013-08-08 00:32:29 +00:00
import random
import string
2014-08-26 17:25:50 +00:00
import six
2013-08-08 00:32:29 +00:00
def random_job_id(size=13):
2014-08-26 17:25:50 +00:00
chars = list(range(10)) + list(string.ascii_uppercase)
job_tag = ''.join(six.text_type(random.choice(chars)) for x in range(size))
2013-10-04 00:34:13 +00:00
return 'j-{0}'.format(job_tag)
2013-08-08 00:32:29 +00:00
def random_instance_group_id(size=13):
2014-08-26 17:25:50 +00:00
chars = list(range(10)) + list(string.ascii_uppercase)
job_tag = ''.join(six.text_type(random.choice(chars)) for x in range(size))
2013-10-04 00:34:13 +00:00
return 'i-{0}'.format(job_tag)