The sdk doesn't have a nice way to update the state of an object. You have to use the 'get' method every time to find out the current state. It would be useful to have something like object.get_new_state() and even more to have a function object.wait_for_state(), which could have an optional timeout and optional fail_state where the function would fail immediately. Example: host.wait_for_state('up', timeout=60*5, fail_state='install failed') Waiting for a state is currently done like this: while api.vms.get(vm_name).status.state != state: sleep(1) which is prone to errors (and ugly), because intuitively you try to do this: vm = api.vms.get(vm_name) while vm.status.state != state: sleep(1)
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.