ironic/ironic/common/boot_devices.py
Lucas Alvares Gomes b96fc97eef Add ManagementInterface
Add a new driver ManagementInterface for management related actions,
the new interface contains the following methods:

* validate() - To validate driver-specific management information. (E.g
  if the node has the right credentials already set)

* set_boot_device() - To set the boot device for a node.

* get_boot_device() - To get the current boot device of a node.

* get_supported_boot_devices() - To get a list of the supported boot
  devices by that driver.

A new file common/boot_devices.py which contains the standardized names
for the acceptable boot devices, the names are based on the IPMITool
names (the default power driver). The idea is that clients won't need to
know the specific boot device names for each driver, drivers which have
different name options than the IPMITool have to translate it internally.

As part of the work to add tests to the FakeManagement interface, other
tests in test_fake.py were modified in order to remove the DB calls.

blueprint: promote-set-boot-device
Change-Id: If2e8074f2e0fbcf962d224024347a0319ac174cf
2014-04-28 14:26:25 +01:00

43 lines
1.2 KiB
Python

# Copyright 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
Mapping of boot devices used when requesting the system to boot
from an alternate device.
The options presented were based on the IPMItool chassis
bootdev command. You can find the documentation at:
http://linux.die.net/man/1/ipmitool
NOTE: This module does not include all the options from ipmitool because
they don't make sense in the limited context of Ironic right now.
"""
PXE = 'pxe'
"Boot from PXE boot"
DISK = 'disk'
"Boot from default Hard-drive"
CDROM = 'cdrom'
"Boot from CD/DVD"
BIOS = 'bios'
"Boot into BIOS setup"
SAFE = 'safe'
"Boot from default Hard-drive, request Safe Mode"