Example #1
0
def adjust_template_collection(template):
    """Method used to build a unique collection name and add it to the template
    dictionary. Returns the updated template.
    """
    unique_collection = 'mars_' + utils.get_random_string(numbers=True, length=8)
    template['collection'] = unique_collection
    return template
Example #2
0
 def adjust_name(template):
     if 'name' not in template.keys():
         if 'template_file' in template.keys():
             template['name'] = parse_template_file_name(template['template_file'])
         else:
             template['name'] = 'auto_' + utils.get_random_string(length=10)
     utils.remove_dictionary_keys(template, ['template_file'])
     return template
Example #3
0
 def adjust_collection(template):
     if 'collection' not in template.keys():
         unique_collection = 'mars_' + utils.get_random_string(numbers=True, length=10)
         template['collection'] = unique_collection
     return template
Example #4
0
 def add_unique_id(workflow_function):
     workflow_function['unique_id'] = utils.get_random_string()