pass version to callback
@@ -6,13 +6,12 @@ SUDO = True
virtualbox_version = '6.1'
-def verify_virtualbox_version(state, host):
+def verify_virtualbox_version(state, host, version):
command = '/usr/bin/virtualbox --help'
status, stdout, stderr = host.run_shell_command(state, command=command, sudo=SUDO)
assert status is True # ensure the command executed OK
- # TODO: how to pass version to this callback?
# TODO: how to return values from callback?
- if virtualbox_version not in str(stdout):
+ if version not in str(stdout):
raise Exception('`{}` did not work as expected.stdout:{} stderr:{}'.format(
command, stdout, stderr))
@@ -56,8 +55,8 @@ if host.fact.linux_name == 'Ubuntu':
'/sbin/vboxconfig',
)
- # TODO: how would I pass version=virtualbox_version to this callback?
python.call(
{'Verify VirtualBox version'},
verify_virtualbox_version,
+ version=virtualbox_version,
)
