2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

Fixed adding vagrant user to abuild group on Alpine

This commit is contained in:
manu
2020-10-20 14:58:03 +02:00
committed by Emanuel Petr
parent 88fd53246f
commit 0465ea02b6

View File

@@ -23,6 +23,8 @@ import textwrap
import functools
import subprocess
import multiprocessing
import grp
import pwd
try:
import urllib.request
except:
@@ -1400,8 +1402,6 @@ def prepare_system_local(features, check_times):
# prepare alpine
elif system == 'alpine':
execute('sudo adduser vagrant abuild')
packages = ['gcc', 'g++', 'make', 'autoconf', 'automake', 'libtool', 'openssl-dev',
'boost-libs', 'boost-dev']
@@ -1434,6 +1434,15 @@ def prepare_system_local(features, check_times):
execute('sudo apk add log4cplus log4cplus-dev --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted',
env=env, timeout=60, check_times=check_times)
# check for existence of 'vagrant' user and 'abuild' group before adding him to the group
try:
pwd.getpwnam('vagrant')
grp.getgrnam('abuild')
except KeyError:
log.info("Can't add 'vagrant' user to 'abuild' group. Vagrant or abuild does not exist.")
else:
execute('sudo adduser vagrant abuild')
else:
raise NotImplementedError('no implementation for %s' % system)