2
Copyright 2010 United States Government as represented by the
3
Administrator of the National Aeronautics and Space Administration.
6
Licensed under the Apache License, Version 2.0 (the "License"); you may
7
not use this file except in compliance with the License. You may obtain
8
a copy of the License at
10
http://www.apache.org/licenses/LICENSE-2.0
12
Unless required by applicable law or agreed to in writing, software
13
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
License for the specific language governing permissions and limitations
18
.. _service_manager_driver:
20
Services, Managers and Drivers
21
==============================
23
The responsibilities of Services, Managers, and Drivers, can be a bit confusing to people that are new to nova. This document attempts to outline the division of responsibilities to make understanding the system a little bit easier.
25
Currently, Managers and Drivers are specified by flags and loaded using utils.load_object(). This method allows for them to be implemented as singletons, classes, modules or objects. As long as the path specified by the flag leads to an object (or a callable that returns an object) that responds to getattr, it should work as a manager or driver.
28
The :mod:`nova.service` Module
29
------------------------------
31
.. automodule:: nova.service
38
The :mod:`nova.manager` Module
39
------------------------------
41
.. automodule:: nova.manager
48
Implementation-Specific Drivers
49
-------------------------------
51
A manager will generally load a driver for some of its tasks. The driver is responsible for specific implementation details. Anything running shell commands on a host, or dealing with other non-python code should probably be happening in a driver.
53
Drivers should minimize touching the database, although it is currently acceptable for implementation specific data. This may be reconsidered at some point.
55
It usually makes sense to define an Abstract Base Class for the specific driver (i.e. VolumeDriver), to define the methods that a different driver would need to implement.