mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
run_id is now in hex per default
... since its primary use is as a string
This commit is contained in:
parent
ba1db3b737
commit
61b5dd2ef0
3 changed files with 4 additions and 5 deletions
|
@ -7,9 +7,8 @@ class BootstrapInformation(object):
|
||||||
self.volume = load_volume(self.manifest.volume)
|
self.volume = load_volume(self.manifest.volume)
|
||||||
self.debug = debug
|
self.debug = debug
|
||||||
import random
|
import random
|
||||||
self.run_id = random.randrange(16 ** 8)
|
self.run_id = '{id:08x}'.format(id=random.randrange(16 ** 8))
|
||||||
import os.path
|
import os.path
|
||||||
workspace_dirname = '{id:x}'.format(id=self.run_id)
|
self.workspace = os.path.join(manifest.bootstrapper['workspace'], self.run_id)
|
||||||
self.workspace = os.path.join(manifest.bootstrapper['workspace'], workspace_dirname)
|
|
||||||
|
|
||||||
self.initd = {'install': {}, 'disable': []}
|
self.initd = {'install': {}, 'disable': []}
|
||||||
|
|
|
@ -49,7 +49,7 @@ class CopyImage(Task):
|
||||||
predecessors = [bootstrap.Bootstrap]
|
predecessors = [bootstrap.Bootstrap]
|
||||||
|
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
loopback_backup_name = 'volume-{id:x}.{ext}.backup'.format(id=info.run_id, ext=info.volume.extension)
|
loopback_backup_name = 'volume-{id}.{ext}.backup'.format(id=info.run_id, ext=info.volume.extension)
|
||||||
destination = os.path.join(info.manifest.bootstrapper['workspace'], loopback_backup_name)
|
destination = os.path.join(info.manifest.bootstrapper['workspace'], loopback_backup_name)
|
||||||
|
|
||||||
def mk_snapshot():
|
def mk_snapshot():
|
||||||
|
|
|
@ -45,7 +45,7 @@ class BundleImage(Task):
|
||||||
phase = phases.image_registration
|
phase = phases.image_registration
|
||||||
|
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
bundle_name = 'bundle-{id:x}'.format(id=info.run_id)
|
bundle_name = 'bundle-{id}'.format(id=info.run_id)
|
||||||
info.bundle_path = os.path.join(info.workspace, bundle_name)
|
info.bundle_path = os.path.join(info.workspace, bundle_name)
|
||||||
log_check_call(['/usr/bin/euca-bundle-image',
|
log_check_call(['/usr/bin/euca-bundle-image',
|
||||||
'--image', info.volume.image_path,
|
'--image', info.volume.image_path,
|
||||||
|
|
Loading…
Add table
Reference in a new issue