mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
MoveImage task now uses image.name from manifest
This commit is contained in:
parent
1e0aa634d2
commit
91cff897c8
1 changed files with 13 additions and 1 deletions
|
@ -19,8 +19,20 @@ class MoveImage(Task):
|
||||||
phase = phases.image_registration
|
phase = phases.image_registration
|
||||||
|
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
|
manifest_vars = {'release': info.manifest.system['release'],
|
||||||
|
'architecture': info.manifest.system['architecture']}
|
||||||
|
from datetime import datetime
|
||||||
|
now = datetime.now()
|
||||||
|
time_vars = ['%a', '%A', '%b', '%B', '%c', '%d', '%f', '%H',
|
||||||
|
'%I', '%j', '%m', '%M', '%p', '%S', '%U', '%w',
|
||||||
|
'%W', '%x', '%X', '%y', '%Y', '%z', '%Z']
|
||||||
|
for var in time_vars:
|
||||||
|
manifest_vars[var] = now.strftime(var)
|
||||||
|
|
||||||
|
image_name = info.manifest.image['name'].format(**manifest_vars)
|
||||||
|
filename = '{image_name}.{ext}'.format(image_name=image_name, ext=info.volume.extension)
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
filename = 'volume-{id:x}.{ext}'.format(id=info.run_id, ext=info.volume.extension)
|
|
||||||
destination = os.path.join(info.manifest.bootstrapper['workspace'], filename)
|
destination = os.path.join(info.manifest.bootstrapper['workspace'], filename)
|
||||||
import shutil
|
import shutil
|
||||||
shutil.move(info.volume.image_path, destination)
|
shutil.move(info.volume.image_path, destination)
|
||||||
|
|
Loading…
Add table
Reference in a new issue