mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Better VM name. Zero left padding build numbers.
This commit is contained in:
parent
23aa412ae2
commit
c2fd114496
1 changed files with 7 additions and 7 deletions
|
@ -40,13 +40,13 @@ def generate_vm_name(platform):
|
|||
'''
|
||||
Generate a random enough vm name
|
||||
'''
|
||||
return 'ZZZ-{0}-{1}'.format(
|
||||
platform,
|
||||
os.environ.get(
|
||||
'BUILD_NUMBER',
|
||||
hashlib.md5(str(random.randint(1, 100000000))).hexdigest()[:6]
|
||||
)
|
||||
)
|
||||
if 'BUILD_NUMBER' in os.environ:
|
||||
random_part = 'BUILD{0:0>6}'.format(os.environ.get('BUILD_NUMBER'))
|
||||
else:
|
||||
random_part = hashlib.md5(
|
||||
str(random.randint(1, 100000000))).hexdigest()[:6]
|
||||
|
||||
return 'ZJENKINS-{0}-{1}'.format(platform, random_part)
|
||||
|
||||
|
||||
def delete_vm(vm_name):
|
||||
|
|
Loading…
Add table
Reference in a new issue