Add copy_external_images

This commit is contained in:
Mikhail Gordeev 2019-09-07 01:18:04 +03:00
parent dc79d5cf6c
commit 9da7bee180
2 changed files with 17 additions and 0 deletions

View File

@ -100,6 +100,10 @@ class CB:
self.bad_arches = cfg.get('bad_arches', [])
self.external_images = cfg.get('external_images')
if self.external_images:
self.external_images = Path(self.external_images).expanduser()
self._packages = cfg.get('packages', {})
self._services = cfg.get('services', {})
self._scripts = cfg.get('scripts', {})
@ -498,6 +502,17 @@ Dir::Etc::preferencesparts "/var/empty";
self.remove_old_tarballs()
def copy_external_images(self):
if self.external_images:
for branch in os.listdir(self.external_images):
if branch not in self.branches:
self.error(f'Unknown branch {branch} in external_images')
with self.pushd(self.external_images / branch):
for image in os.listdir():
self.copy_image(image,
self.images_dir / branch / image)
def sign(self):
sum_file = self.checksum_command.upper()
for branch in self.branches():

View File

@ -6,6 +6,8 @@ log_level: info
bad_arches:
- armh
external_images: ~/external_images
images:
opennebula:
target: vm/opennebula-systemd