~ubuntu-branches/ubuntu/vivid/ironic/vivid-updates

« back to all changes in this revision

Viewing changes to ironic/drivers/agent.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2015-03-30 11:14:57 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20150330111457-kr4ju3guf22m4vbz
Tags: 2015.1~b3-0ubuntu1
* New upstream release.
  + d/control: 
    - Align with upstream dependencies.
    - Add dh-python to build-dependencies.
    - Add psmisc as a dependency. (LP: #1358820)
  + d/p/fix-requirements.patch: Rediffed.
  + d/ironic-conductor.init.in: Fixed typos in LSB headers,
    thanks to JJ Asghar. (LP: #1429962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
 
 
15
from oslo_utils import importutils
 
16
 
 
17
from ironic.common import exception
 
18
from ironic.common.i18n import _
15
19
from ironic.drivers import base
16
20
from ironic.drivers.modules import agent
17
21
from ironic.drivers.modules import ipminative
18
22
from ironic.drivers.modules import ipmitool
19
23
from ironic.drivers.modules import ssh
 
24
from ironic.drivers.modules import virtualbox
20
25
 
21
26
 
22
27
class AgentAndIPMIToolDriver(base.BaseDriver):
76
81
        self.deploy = agent.AgentDeploy()
77
82
        self.management = ssh.SSHManagement()
78
83
        self.vendor = agent.AgentVendorInterface()
 
84
 
 
85
 
 
86
class AgentAndVirtualBoxDriver(base.BaseDriver):
 
87
    """Agent + VirtualBox driver.
 
88
 
 
89
    NOTE: This driver is meant only for testing environments.
 
90
 
 
91
    This driver implements the `core` functionality, combining
 
92
    :class:`ironic.drivers.modules.virtualbox.VirtualBoxPower` (for power
 
93
        on/off and reboot of VirtualBox virtual machines), with
 
94
    :class:`ironic.drivers.modules.agent.AgentDeploy` (for image
 
95
    deployment). Implementations are in those respective classes; this class
 
96
    is merely the glue between them.
 
97
    """
 
98
 
 
99
    def __init__(self):
 
100
        if not importutils.try_import('pyremotevbox'):
 
101
            raise exception.DriverLoadError(
 
102
                    driver=self.__class__.__name__,
 
103
                    reason=_("Unable to import pyremotevbox library"))
 
104
        self.power = virtualbox.VirtualBoxPower()
 
105
        self.deploy = agent.AgentDeploy()
 
106
        self.management = virtualbox.VirtualBoxManagement()
 
107
        self.vendor = agent.AgentVendorInterface()