2014-11-27 14:09:48 +00:00
|
|
|
# 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.
|
|
|
|
|
|
|
|
"""Example plugin."""
|
|
|
|
|
2015-07-27 06:07:16 +00:00
|
|
|
from oslo_log import log
|
2014-11-27 14:09:48 +00:00
|
|
|
|
2015-05-26 05:47:55 +00:00
|
|
|
from ironic_inspector.plugins import base
|
2014-11-27 14:09:48 +00:00
|
|
|
|
|
|
|
|
2015-07-27 06:07:16 +00:00
|
|
|
LOG = log.getLogger('ironic_inspector.plugins.example')
|
2014-11-27 14:09:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ExampleProcessingHook(base.ProcessingHook): # pragma: no cover
|
2015-06-08 15:44:09 +00:00
|
|
|
def before_processing(self, introspection_data, **kwargs):
|
2015-06-08 14:43:08 +00:00
|
|
|
LOG.debug('before_processing: %s', introspection_data)
|
2014-11-27 14:09:48 +00:00
|
|
|
|
2015-09-07 12:43:23 +00:00
|
|
|
def before_update(self, introspection_data, node_info, **kwargs):
|
2015-06-08 15:44:09 +00:00
|
|
|
LOG.debug('before_update: %s (node %s)', introspection_data,
|
|
|
|
node_info.uuid)
|
2015-06-10 11:16:02 +00:00
|
|
|
|
|
|
|
|
2015-07-17 10:14:29 +00:00
|
|
|
def example_not_found_hook(introspection_data, **kwargs):
|
2015-06-10 11:16:02 +00:00
|
|
|
LOG.debug('Processing node not found %s', introspection_data)
|
2015-07-31 10:39:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ExampleRuleAction(base.RuleActionPlugin): # pragma: no cover
|
|
|
|
def apply(self, node_info, params, **kwargs):
|
|
|
|
LOG.debug('apply action to %s: %s', node_info.uuid, params)
|