summaryrefslogtreecommitdiffstats
path: root/compass-deck/db/api/switch.py
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2018-10-11 11:05:02 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2018-10-30 15:06:10 +0800
commitf89ef9a9ee968c778af3444c7f9d2a39489fcf2b (patch)
treeb5d3894a076ac2aca47b2c5f3dcf83160375a463 /compass-deck/db/api/switch.py
parentc5a7aaf83d500ec7c4b02d4cfddaf86b85182b2c (diff)
Manage host power from cobbler
JIRA: COMPASS-616 1. Use fence_ipmilan to control power of baremetal servers. Add fence_libvirt to control power of virtual servers. 2. Use power_manage field instead of ipmi field 3. Add power_type to specify machine's power manage tool 4. Store power manage information in db and update to cobbler 5. Manage power from cobbler for both virtual and baremetal machines Change-Id: Ic36ae640dc0aa1703566b5b0b549880a71be36e4 Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
Diffstat (limited to 'compass-deck/db/api/switch.py')
-rw-r--r--compass-deck/db/api/switch.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/compass-deck/db/api/switch.py b/compass-deck/db/api/switch.py
index 647eec0..92d7a7f 100644
--- a/compass-deck/db/api/switch.py
+++ b/compass-deck/db/api/switch.py
@@ -58,17 +58,17 @@ UPDATED_FILTERS_FIELDS = ['put_machine_filters']
PATCHED_FILTERS_FIELDS = ['patched_machine_filters']
ADDED_MACHINES_FIELDS = ['mac']
OPTIONAL_ADDED_MACHINES_FIELDS = [
- 'ipmi_credentials', 'tag', 'location', 'owner_id'
+ 'power_manage', 'tag', 'location', 'owner_id'
]
ADDED_SWITCH_MACHINES_FIELDS = ['port']
OPTIONAL_ADDED_SWITCH_MACHINES_FIELDS = ['vlans']
UPDATED_MACHINES_FIELDS = [
- 'ipmi_credentials',
+ 'power_manage',
'tag', 'location'
]
UPDATED_SWITCH_MACHINES_FIELDS = ['port', 'vlans', 'owner_id']
PATCHED_MACHINES_FIELDS = [
- 'patched_ipmi_credentials',
+ 'patched_power_manage',
'patched_tag', 'patched_location'
]
PATCHED_SWITCH_MACHINES_FIELDS = ['patched_vlans']
@@ -85,13 +85,13 @@ RESP_ACTION_FIELDS = [
RESP_MACHINES_FIELDS = [
'id', 'switch_id', 'switch_ip', 'machine_id', 'switch_machine_id',
'port', 'vlans', 'mac', 'owner_id',
- 'ipmi_credentials', 'tag', 'location',
+ 'power_manage', 'tag', 'location',
'created_at', 'updated_at'
]
RESP_MACHINES_HOSTS_FIELDS = [
'id', 'switch_id', 'switch_ip', 'machine_id', 'switch_machine_id',
'port', 'vlans', 'mac',
- 'ipmi_credentials', 'tag', 'location', 'ip',
+ 'power_manage', 'tag', 'location', 'ip',
'name', 'hostname', 'os_name', 'owner',
'os_installer', 'reinstall_os', 'os_installed',
'clusters', 'created_at', 'updated_at'
@@ -988,13 +988,13 @@ def update_switchmachine(switch_machine_id, user=None, session=None, **kwargs):
)
-# replace [vlans, ipmi_credentials, tag, location] to
-# [patched_vlans, patched_ipmi_credentials, patched_tag,
+# replace [vlans, power_manage, tag, location] to
+# [patched_vlans, patched_power_manage, patched_tag,
# patched_location] in kwargs. It tells db these fields will
# be patched.
@utils.replace_filters(
vlans='patched_vlans',
- ipmi_credentials='patched_ipmi_credentials',
+ power_manage='patched_power_manage',
tag='patched_tag',
location='patched_location'
)
@@ -1024,13 +1024,13 @@ def patch_switch_machine(
)
-# replace [vlans, ipmi_credentials, tag, location] to
-# [patched_vlans, patched_ipmi_credentials, patched_tag,
+# replace [vlans, power_manage, tag, location] to
+# [patched_vlans, patched_power_manage, patched_tag,
# patched_location] in kwargs. It tells db these fields will
# be patched.
@utils.replace_filters(
vlans='patched_vlans',
- ipmi_credentials='patched_ipmi_credentials',
+ power_manage='patched_power_manage',
tag='patched_tag',
location='patched_location'
)