Skip to content

Instantly share code, notes, and snippets.

@dav1x
Created September 6, 2017 15:37
Show Gist options
  • Save dav1x/5c4b66998042c8a11f4cd35c4a582a8d to your computer and use it in GitHub Desktop.
Save dav1x/5c4b66998042c8a11f4cd35c4a582a8d to your computer and use it in GitHub Desktop.
if not cluster_id:
#create a unique cluster_id first
cluster_id = ''.join(random.choice('0123456789ABCDEF') for i in range(20))
config.set('vmware', 'cluster_id', cluster_id)
for line in fileinput.input(vmware_ini_path, inplace=True):
if line.startswith('cluster_id'):
print "cluster_id=" + str(cluster_id)
else:
print line,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment