summaryrefslogtreecommitdiffstats
path: root/fuel/deploy/dha_adapters
diff options
context:
space:
mode:
Diffstat (limited to 'fuel/deploy/dha_adapters')
-rw-r--r--fuel/deploy/dha_adapters/__init__.py8
-rw-r--r--fuel/deploy/dha_adapters/hardware_adapter.py13
-rw-r--r--fuel/deploy/dha_adapters/hp_adapter.py13
-rw-r--r--fuel/deploy/dha_adapters/ipmi_adapter.py13
-rw-r--r--fuel/deploy/dha_adapters/libvirt_adapter.py17
5 files changed, 60 insertions, 4 deletions
diff --git a/fuel/deploy/dha_adapters/__init__.py b/fuel/deploy/dha_adapters/__init__.py
index e69de29..fb73157 100644
--- a/fuel/deploy/dha_adapters/__init__.py
+++ b/fuel/deploy/dha_adapters/__init__.py
@@ -0,0 +1,8 @@
+###############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# szilard.cserey@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+###############################################################################
diff --git a/fuel/deploy/dha_adapters/hardware_adapter.py b/fuel/deploy/dha_adapters/hardware_adapter.py
index a8d0121..29e04f1 100644
--- a/fuel/deploy/dha_adapters/hardware_adapter.py
+++ b/fuel/deploy/dha_adapters/hardware_adapter.py
@@ -1,7 +1,18 @@
+###############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# szilard.cserey@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+###############################################################################
+
import yaml
import io
+
class HardwareAdapter(object):
+
def __init__(self, yaml_path):
self.dha_struct = None
self.parse_yaml(yaml_path)
@@ -45,4 +56,4 @@ class HardwareAdapter(object):
return node['username'], node['password']
def get_disks(self):
- return self.dha_struct['disks'] \ No newline at end of file
+ return self.dha_struct['disks']
diff --git a/fuel/deploy/dha_adapters/hp_adapter.py b/fuel/deploy/dha_adapters/hp_adapter.py
index 8cfec34..51f55f3 100644
--- a/fuel/deploy/dha_adapters/hp_adapter.py
+++ b/fuel/deploy/dha_adapters/hp_adapter.py
@@ -1,3 +1,13 @@
+###############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# szilard.cserey@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+###############################################################################
+
+
import common
from ipmi_adapter import IpmiAdapter
from ssh_client import SSHClient
@@ -10,6 +20,7 @@ DEV = {'pxe': 'bootsource5',
ROOT = '/system1/bootconfig1'
+
class HpAdapter(IpmiAdapter):
def __init__(self, yaml_path):
@@ -22,4 +33,4 @@ class HpAdapter(IpmiAdapter):
with ssh as s:
for order, dev in enumerate(boot_order_list):
s.exec_cmd('set %s/%s bootorder=%s'
- % (ROOT, DEV[dev], order+1))
+ % (ROOT, DEV[dev], order + 1))
diff --git a/fuel/deploy/dha_adapters/ipmi_adapter.py b/fuel/deploy/dha_adapters/ipmi_adapter.py
index 1bef898..25aa36e 100644
--- a/fuel/deploy/dha_adapters/ipmi_adapter.py
+++ b/fuel/deploy/dha_adapters/ipmi_adapter.py
@@ -1,3 +1,13 @@
+###############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# szilard.cserey@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+###############################################################################
+
+
import common
import time
from hardware_adapter import HardwareAdapter
@@ -6,6 +16,7 @@ log = common.log
exec_cmd = common.exec_cmd
err = common.err
+
class IpmiAdapter(HardwareAdapter):
def __init__(self, yaml_path):
@@ -104,4 +115,4 @@ class IpmiAdapter(HardwareAdapter):
exec_cmd('%s chassis bootdev cdrom' % cmd_prefix)
elif dev == 'disk':
exec_cmd('%s chassis bootdev disk options=persistent'
- % cmd_prefix) \ No newline at end of file
+ % cmd_prefix)
diff --git a/fuel/deploy/dha_adapters/libvirt_adapter.py b/fuel/deploy/dha_adapters/libvirt_adapter.py
index 1eca548..b285c16 100644
--- a/fuel/deploy/dha_adapters/libvirt_adapter.py
+++ b/fuel/deploy/dha_adapters/libvirt_adapter.py
@@ -1,3 +1,13 @@
+###############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# szilard.cserey@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+###############################################################################
+
+
import common
from lxml import etree
from hardware_adapter import HardwareAdapter
@@ -10,6 +20,7 @@ DEV = {'pxe': 'network',
'disk': 'hd',
'iso': 'cdrom'}
+
class LibvirtAdapter(HardwareAdapter):
def __init__(self, yaml_path):
@@ -88,7 +99,8 @@ class LibvirtAdapter(HardwareAdapter):
def node_eject_iso(self, node_id):
vm_name = self.get_node_property(node_id, 'libvirtName')
device = self.get_name_of_device(vm_name, 'cdrom')
- exec_cmd('virsh change-media %s --eject %s' % (vm_name, device), False)
+ exec_cmd('virsh change-media %s --eject %s --config --live'
+ % (vm_name, device), False)
def node_insert_iso(self, node_id, iso_file):
vm_name = self.get_node_property(node_id, 'libvirtName')
@@ -119,3 +131,6 @@ class LibvirtAdapter(HardwareAdapter):
device = target.get('dev')
if device:
return device
+
+ def get_virt_net_conf_dir(self):
+ return self.dha_struct['virtNetConfDir']