hammer exceptions (missing vagrant, ssh, destroy)
Hammer threw exceptions on me in three separate scenarios.
Trying vagrant on a new ubuntu 20.04 results in this:
$ ./hammer.py prepare-system -s debian -r 9 -p virtualbox
[HAMMER] 2020-10-30 09:52:19,584 Enabled features: perfdhcp install docs unittest
[HAMMER] 2020-10-30 09:52:20,722 Prepared vagrant system hmr-debian-9-kea-srv-3882304403 in /home/thomson/devel/kea/hammer/debian-9/vbox
[HAMMER] 2020-10-30 09:52:20,722 >>>>> Executing vagrant status in /home/thomson/devel/kea/hammer/debian-9/vbox
[HAMMER] 2020-10-30 09:52:20,726 /bin/sh: 1: vagrant: not found
Traceback (most recent call last):
File "./hammer.py", line 2434, in <module>
main()
File "./hammer.py", line 2414, in main
prepare_system_cmd(args)
File "./hammer.py", line 2316, in prepare_system_cmd
prepare_system_in_vagrant(args.provider, args.system, args.revision, features,
File "./hammer.py", line 1470, in prepare_system_in_vagrant
ve.bring_up_latest_box()
File "./hammer.py", line 605, in bring_up_latest_box
if self.get_status() == 'running':
File "./hammer.py", line 598, in get_status
_, out = execute("vagrant status", cwd=self.vagrant_dir, timeout=15, capture=True, quiet=True)
File "./hammer.py", line 321, in execute
raise ExecutionError("The command return non-zero exitcode %s, cmd: '%s'" % (exitcode, cmd))
__main__.ExecutionError: The command return non-zero exitcode 127, cmd: 'vagrant status'
Another exception:
$ ./hammer.py ssh
Traceback (most recent call last):
File "./hammer.py", line 2434, in <module>
main()
File "./hammer.py", line 2421, in main
ssh(args.provider, args.system, args.revision)
File "./hammer.py", line 1951, in ssh
ve = VagrantEnv(provider, system, revision, [], 'kea', False)
File "./hammer.py", line 477, in __init__
self.image_tpl = image_tpl = IMAGE_TEMPLATES[key][image_template_variant]
KeyError: 'all-all-virtualbox'
And a third one:
./hammer.py destroy
[HAMMER] 2020-10-30 10:03:22,050 >>>>> Executing vagrant destroy in /home/thomson/devel/kea
A Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.
Traceback (most recent call last):
File "./hammer.py", line 2434, in <module>
main()
File "./hammer.py", line 2427, in main
destroy_system(args.directory)
File "./hammer.py", line 2199, in destroy_system
execute('vagrant destroy', cwd=path, interactive=True)
File "./hammer.py", line 321, 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: 'vagrant destroy'