Skip to content

Fixed adding vagrant user to abuild group on Alpine

Emanuel Petr requested to merge fix-prepare-local-system-for-kea-on-alpine into master

Installing dependencies for Kea on fresh Alpine failed due the command 'sudo adduser vagrant abuild' which tries to add vagrant user to abuild group even though the vagrant user nor abuild group does exist on the system.

# ./hammer.py -v prepare-system -p local -w pgsql,mysql
[HAMMER]  2020-10-20 08:28:06,907 L2299 Enabled features: perfdhcp install docs mysql unittest pgsql
[HAMMER]  2020-10-20 08:28:06,908 L1134 Preparing deps for alpine 3.12
[HAMMER]  2020-10-20 08:28:06,908 L0250 >>>>> Executing sudo adduser vagrant abuild in /root
addgroup: unknown user vagrant
Traceback (most recent call last):
  File "/tmp/hammer.py", line 2425, in <module>
    main()
  File "/tmp/hammer.py", line 2405, in main
    prepare_system_cmd(args)
  File "/tmp/hammer.py", line 2302, in prepare_system_cmd
    prepare_system_local(features, args.check_times)
  File "/tmp/hammer.py", line 1403, in prepare_system_local
    execute('sudo adduser vagrant abuild')
  File "/tmp/hammer.py", line 319, in execute
    raise ExecutionError("The command return non-zero exitcode %s, cmd: '%s'" % (exitcode, cmd))
__main__.ExecutionError: The command return non-zero exitcode 1, cmd: 'sudo adduser vagrant abuild'

The proposed fix moved 'sudo adduser vagrant abuild' behind the code which creates 'abuild' group (if native-pkg feature is selected) and check for existence of vagrant user and abuild group before adding user to the group.

Merge request reports