diff options
| author | Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com> | 2012-11-20 14:26:27 -0500 |
|---|---|---|
| committer | Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com> | 2012-11-21 08:04:21 -0500 |
| commit | e6ba5845cd0bebc5c606e976296164081fbbfcd3 (patch) | |
| tree | 3de45c69da89e3b65582188abdfd2073cf8f34f4 | |
| parent | 9dfb4b420f9d15d348f9fa9a2a0cb1a57f4e5771 (diff) | |
| download | nova-e6ba5845cd0bebc5c606e976296164081fbbfcd3.tar.gz nova-e6ba5845cd0bebc5c606e976296164081fbbfcd3.tar.xz nova-e6ba5845cd0bebc5c606e976296164081fbbfcd3.zip | |
Add methods to Host operations to fake hypervisor
This patch implements some features present in os-hosts extension that are not
implemented in fake hypervisor:
- Power Actions: Shutdown/Reboot/Startup a host
- Change host status: enable or disable
- Set/Unset the host into maintenance mode
With this patch we're able to get full api samples for this extension
Change-Id: I3b76e3070e326b39a67b9d4d25b5e3d91a3c102f
| -rw-r--r-- | nova/virt/fake.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nova/virt/fake.py b/nova/virt/fake.py index 49f7b548b..3b5a7e288 100644 --- a/nova/virt/fake.py +++ b/nova/virt/fake.py @@ -363,16 +363,20 @@ class FakeDriver(driver.ComputeDriver): def host_power_action(self, host, action): """Reboots, shuts down or powers up the host.""" - pass + return action def host_maintenance_mode(self, host, mode): """Start/Stop host maintenance window. On start, it triggers guest VMs evacuation.""" - pass + if not mode: + return 'off_maintenance' + return 'on_maintenance' def set_host_enabled(self, host, enabled): """Sets the specified host's ability to accept new instances.""" - pass + if enabled: + return 'enabled' + return 'disabled' def get_disk_available_least(self): """ """ |
