MCPcopy Create free account
hub / github.com/apache/cloudstack / random_gen

Function random_gen

tools/marvin/marvin/lib/utils.py:150–155  ·  view source on GitHub ↗

Generate Random Strings of variable length

(id=None, size=6, chars=string.ascii_uppercase + string.digits)

Source from the content-addressed store, hash-verified

148
149
150def random_gen(id=None, size=6, chars=string.ascii_uppercase + string.digits):
151 """Generate Random Strings of variable length"""
152 randomstr = ''.join(random.choice(chars) for x in range(size))
153 if id:
154 return ''.join([id, '-', randomstr])
155 return randomstr
156
157
158def cleanup_resources(api_client, resources):

Callers 15

createLogsMethod · 0.90
finalizeMethod · 0.90
createZoneMethod · 0.90
__createUserApiClientMethod · 0.90
createMethod · 0.90
createMethod · 0.90
createMethod · 0.90
createMethod · 0.90
create_from_snapshotMethod · 0.90
createMethod · 0.90
registerMethod · 0.90
_set_commandMethod · 0.90

Calls 1

joinMethod · 0.45