From: Michal Nowikowski Date: Mon, 24 Jun 2019 19:58:48 +0000 (+0200) Subject: hammer: added support for debian-10, some other various fixes X-Git-Tag: Kea-1.6.0-beta2~213 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fhammer-debian-10;p=thirdparty%2Fkea.git hammer: added support for debian-10, some other various fixes --- diff --git a/hammer.py b/hammer.py index 89e09a6892..a02c81913f 100755 --- a/hammer.py +++ b/hammer.py @@ -44,7 +44,7 @@ SYSTEMS = { 'centos': ['7'], 'rhel': ['8'], 'ubuntu': ['16.04', '18.04', '18.10', '19.04'], - 'debian': ['8', '9'], + 'debian': ['8', '9', '10'], 'freebsd': ['11.2', '12.0'], } @@ -73,6 +73,8 @@ IMAGE_TEMPLATES = { 'debian-8-virtualbox': {'bare': 'debian/jessie64', 'kea': 'godfryd/kea-debian-8'}, 'debian-9-lxc': {'bare': 'godfryd/lxc-debian-9', 'kea': 'godfryd/kea-debian-9'}, 'debian-9-virtualbox': {'bare': 'debian/stretch64', 'kea': 'godfryd/kea-debian-9'}, + 'debian-10-lxc': {'bare': 'godfryd/lxc-debian-10', 'kea': 'godfryd/kea-debian-10'}, + 'debian-10-virtualbox': {'bare': 'debian/buster64', 'kea': 'godfryd/kea-debian-10'}, 'freebsd-11.2-virtualbox': {'bare': 'generic/freebsd11', 'kea': 'godfryd/kea-freebsd-11.2'}, 'freebsd-12.0-virtualbox': {'bare': 'generic/freebsd12', 'kea': 'godfryd/kea-freebsd-12.0'}, } @@ -153,7 +155,7 @@ def get_system_revision(): if system == 'Linux': system, revision, _ = platform.dist() # pylit: disable=deprecated-method if system == 'debian': - revision = revision[0] + revision = revision.split('.')[0] elif system == 'redhat': system = 'rhel' revision = revision[0] @@ -535,23 +537,17 @@ class VagrantEnv(object): def package(self): """Package Vagrant system into Vagrant box.""" + execute('vagrant halt', cwd=self.vagrant_dir, dry_run=self.dry_run, raise_error=False) - if self.provider == 'virtualbox': - box_path = "kea-%s-%s.box" % (self.system, self.revision) - full_box_path = os.path.join(self.vagrant_dir, box_path) - if os.path.exists(full_box_path): - os.unlink(full_box_path) + box_path = os.path.join(self.vagrant_dir, 'kea-%s-%s.box' % (self.system, self.revision)) + if os.path.exists(box_path): + os.unlink(box_path) + if self.provider == 'virtualbox': cmd = "vagrant package --output %s" % box_path execute(cmd, cwd=self.vagrant_dir, timeout=4 * 60, dry_run=self.dry_run) elif self.provider == 'lxc': - execute('vagrant halt', cwd=self.vagrant_dir, dry_run=self.dry_run, raise_error=False) - - box_path = os.path.join(self.vagrant_dir, 'kea-%s-%s.box' % (self.system, self.revision)) - if os.path.exists(box_path): - os.unlink(box_path) - lxc_box_dir = os.path.join(self.vagrant_dir, 'lxc-box') if os.path.exists(lxc_box_dir): execute('sudo rm -rf %s' % lxc_box_dir) @@ -892,7 +888,7 @@ def _configure_pgsql(system, features): cmd += "GRANT ALL PRIVILEGES ON DATABASE keatest TO keatest;\n" cmd += "ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES to keatest_readonly;\n" cmd += "EOF\n\"" - execute(cmd) + execute(cmd, cwd='/tmp') # CWD to avoid: could not change as posgres user directory to "/home/jenkins": Permission denied if 'forge' in features: cmd = "bash -c \"cat <