4a8d736621
Change-Id: I9734be9757698993ab290764d8a0aa24c367ab87 Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
# Copyright 2012 OpenStack Foundation
|
|
# 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.
|
|
|
|
"""Handling introspection request."""
|
|
|
|
import logging
|
|
|
|
from daisy_discoverd import conf
|
|
from daisy_discoverd import node_cache
|
|
from daisy_discoverd import utils
|
|
|
|
|
|
LOG = logging.getLogger("daisy_discoverd.introspect")
|
|
# See http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html # noqa
|
|
VALID_STATES = {'enroll', 'manageable', 'inspecting'}
|
|
|
|
|
|
def _get_ipmi_address(node):
|
|
# All these are kind-of-ipmi
|
|
for name in ('ipmi_address', 'ilo_address', 'drac_host'):
|
|
value = node.driver_info.get(name)
|
|
if value:
|
|
return value
|