93 lines
2.8 KiB
Python
93 lines
2.8 KiB
Python
# Copyright 2016 Red Hat, Inc.
|
|
#
|
|
# 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.
|
|
|
|
"""
|
|
Abstract base class for all hardware types.
|
|
"""
|
|
|
|
import abc
|
|
|
|
import six
|
|
|
|
from ironic.drivers.modules.network import noop as noop_net
|
|
from ironic.drivers.modules import noop
|
|
from ironic.drivers.modules.storage import noop as noop_storage
|
|
|
|
|
|
@six.add_metaclass(abc.ABCMeta)
|
|
class AbstractHardwareType(object):
|
|
"""Abstract base class for all hardware types.
|
|
|
|
Hardware type is a family of hardware supporting the same set of interfaces
|
|
from the ironic standpoint. This can be as wide as all hardware supporting
|
|
the IPMI protocol or as narrow as several hardware models supporting some
|
|
specific interfaces.
|
|
|
|
A hardware type defines an ordered list of supported implementations for
|
|
each driver interface (power, deploy, etc).
|
|
"""
|
|
|
|
supported = True
|
|
"""Whether hardware is supported by the community."""
|
|
|
|
# Required hardware interfaces
|
|
|
|
@abc.abstractproperty
|
|
def supported_boot_interfaces(self):
|
|
"""List of supported boot interfaces."""
|
|
|
|
@abc.abstractproperty
|
|
def supported_deploy_interfaces(self):
|
|
"""List of supported deploy interfaces."""
|
|
|
|
@abc.abstractproperty
|
|
def supported_management_interfaces(self):
|
|
"""List of supported management interfaces."""
|
|
|
|
@abc.abstractproperty
|
|
def supported_power_interfaces(self):
|
|
"""List of supported power interfaces."""
|
|
|
|
# Optional hardware interfaces
|
|
|
|
@property
|
|
def supported_console_interfaces(self):
|
|
"""List of supported console interfaces."""
|
|
return [noop.NoConsole]
|
|
|
|
@property
|
|
def supported_inspect_interfaces(self):
|
|
"""List of supported inspect interfaces."""
|
|
return [noop.NoInspect]
|
|
|
|
@property
|
|
def supported_network_interfaces(self):
|
|
"""List of supported network interfaces."""
|
|
return [noop_net.NoopNetwork]
|
|
|
|
@property
|
|
def supported_raid_interfaces(self):
|
|
"""List of supported raid interfaces."""
|
|
return [noop.NoRAID]
|
|
|
|
@property
|
|
def supported_storage_interfaces(self):
|
|
"""List of supported storage interfaces."""
|
|
return [noop_storage.NoopStorage]
|
|
|
|
@property
|
|
def supported_vendor_interfaces(self):
|
|
"""List of supported vendor interfaces."""
|
|
return [noop.NoVendor]
|