Change in vdsm[master]: storage: ignore missing pv metadata
by xfrancis@redhat.com
Xavi Francisco has uploaded a new change for review.
Change subject: storage: ignore missing pv metadata
......................................................................
storage: ignore missing pv metadata
Ignore missing metadata when trying to parse PV information from a
problematic LVM device.
When vdsm tries to read metadata from a LVM physical volume and
there's an error, the lvm command exits normally but no pv metadata
is retrieved and a message is printed in stderr. When this happens the
method getPV() in LVM returns None. This has to be checked whenever the
PV metadata is needed to avoid throwing an exception.
Change-Id: I9932b044c8b439dc8b1f09191a5d89f4bc44c38a
Bug-Url: https://bugzilla.redhat.com/1048696
Signed-off-by: Xavi Francisco <xfrancis(a)redhat.com>
---
M vdsm/storage/blockSD.py
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/27442/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 377b132..c41e737 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -668,6 +668,10 @@
continue
pv = lvm.getPV(dev)
+ if not pv:
+ cls.log.warning("Could not get metadata from the device: %s",
+ dev)
+ continue
pvInfo = {}
pvInfo["guid"] = os.path.basename(pv.name)
pvInfo["uuid"] = pv.uuid
--
To view, visit http://gerrit.ovirt.org/27442
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9932b044c8b439dc8b1f09191a5d89f4bc44c38a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Xavi Francisco <xfrancis(a)redhat.com>
9 years, 2 months
Change in vdsm[master]: vdsm-tool: vdsm-id: add force option to force generate id
by Alon Bar-Lev
Alon Bar-Lev has uploaded a new change for review.
Change subject: vdsm-tool: vdsm-id: add force option to force generate id
......................................................................
vdsm-tool: vdsm-id: add force option to force generate id
this is handy to hide the existence and usage of /etc/vdsm/vdsm.id from
users (other components).
Change-Id: I89f1e29c9cdad0cadb32545fa27c1702ad2e116a
Signed-off-by: Alon Bar-Lev <alonbl(a)redhat.com>
---
M lib/vdsm/tool/vdsm-id.py
M lib/vdsm/utils.py
2 files changed, 35 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/20808/1
diff --git a/lib/vdsm/tool/vdsm-id.py b/lib/vdsm/tool/vdsm-id.py
index 109c382..01f94a9 100644
--- a/lib/vdsm/tool/vdsm-id.py
+++ b/lib/vdsm/tool/vdsm-id.py
@@ -17,9 +17,13 @@
# Refer to the README and COPYING files for full details of the license
#
+
+import sys
+import argparse
+
+
from vdsm.utils import getHostUUID
from vdsm.tool import expose
-import sys
@expose("vdsm-id")
@@ -27,7 +31,19 @@
"""
Printing host uuid
"""
- hostUUID = getHostUUID(False)
+ parser = argparse.ArgumentParser('vdsm-tool configure')
+ parser.add_argument(
+ '--force',
+ dest='force',
+ default=False,
+ action='store_true',
+ help='Generate vdsmid if not available',
+ )
+ args = parser.parse_args(sys.argv[2:])
+ hostUUID = getHostUUID(
+ legacy=False,
+ force=args.force,
+ )
if hostUUID is None:
raise RuntimeError('Cannot retrieve host UUID')
sys.stdout.write(hostUUID)
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index 78d055e..d38a273 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -48,6 +48,7 @@
import subprocess
import threading
import time
+import uuid
from cpopen import CPopen as BetterPopen
import constants
@@ -599,7 +600,7 @@
__hostUUID = None
-def getHostUUID(legacy=True):
+def getHostUUID(legacy=True, force=False):
global __hostUUID
if __hostUUID:
return __hostUUID
@@ -624,6 +625,14 @@
if p.returncode == 0 and 'Not' not in out:
#Avoid error string - 'Not Settable' or 'Not Present'
__hostUUID = out.strip()
+ elif force:
+ hostid = str(uuid.uuid4())
+ with open(constants.P_VDSM_NODE_ID, 'w') as f:
+ f.write("%s\n", hostid)
+ if isOvirtNode():
+ from ovirtnode import ovirtfunctions
+ ovirtfunctions.ovirt_store_config(constants.P_VDSM_NODE_ID)
+ __hostUUID = hostid
else:
logging.warning('Could not find host UUID.')
@@ -877,3 +886,10 @@
logging.error("Panic: %s", msg, exc_info=True)
os.killpg(0, 9)
sys.exit(-3)
+
+
+def isOvirtNode():
+ return (
+ os.path.exists('/etc/rhev-hypervisor-release') or
+ glob.glob('/etc/ovirt-node-*-release')
+ )
--
To view, visit http://gerrit.ovirt.org/20808
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I89f1e29c9cdad0cadb32545fa27c1702ad2e116a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alonbl(a)redhat.com>
9 years, 2 months
Change in vdsm[master]: vdsm-gluster: Added gluster volume geo-replication start verb
by tjeyasin@redhat.com
Hello Ayal Baron, Bala.FA, Saggi Mizrahi, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/17766
to review the following change.
Change subject: vdsm-gluster: Added gluster volume geo-replication start verb
......................................................................
vdsm-gluster: Added gluster volume geo-replication start verb
Start the geo-replication session between the hosts.
Start distributed geo-replication on all the nodes that are a part
of the master-volume. Even if any node, that is a part of the
master-volume is down, the command will still be successful.
Change-Id: I3cf03c748cf9fe28efe7d407727cd52da20701c5
Signed-off-by: Timothy Asir <tjeyasin(a)redhat.com>
---
M client/vdsClientGluster.py
M vdsm/gluster/api.py
M vdsm/gluster/cli.py
M vdsm/gluster/exception.py
4 files changed, 100 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/17766/1
diff --git a/client/vdsClientGluster.py b/client/vdsClientGluster.py
index 90af83e..feb6387 100644
--- a/client/vdsClientGluster.py
+++ b/client/vdsClientGluster.py
@@ -424,6 +424,34 @@
pp.pprint(status)
return status['status']['code'], status['status']['message']
+ def do_glusterVolumeGeoRepStart(self, args):
+ params = self._eqSplit(args)
+ masterVolName = params.get('masterVolName', '')
+ slaveHost = params.get('slaveHost', '')
+ slaveVolName = params.get('slaveVolName', '')
+ if not(masterVolName and slaveHost and slaveVolName):
+ raise ValueError
+
+ status = self.s.glusterVolumeGeoRepStart(masterVolName,
+ slaveHost,
+ slaveVolName)
+ pp.pprint(status)
+ return status['status']['code'], status['status']['message']
+
+ def do_glusterVolumeGeoRepStop(self, args):
+ params = self._eqSplit(args)
+ masterVolName = params.get('masterVolName', '')
+ slaveHost = params.get('slaveHost', '')
+ slaveVolName = params.get('slaveVolName', '')
+ if not(masterVolName and slaveHost and slaveVolName):
+ raise ValueError
+
+ status = self.s.glusterVolumeGeoRepStop(masterVolName,
+ slaveHost,
+ slaveVolName)
+ pp.pprint(status)
+ return status['status']['code'], status['status']['message']
+
def getGlusterCmdDict(serv):
return \
@@ -705,4 +733,26 @@
'not set'
'(swift, glusterd, smb, memcached)'
)),
+ 'glusterVolumeGeoRepStart': (
+ serv.do_glusterVolumeGeoRepStart,
+ ('masterVolName=<master_volume_name> slaveHost=<slave_host> '
+ 'slaveVolName=<slave_volume_name>\n\t'
+ '<master_volume_name> is an existing volume name in the '
+ 'master node\n\t'
+ '<slave_host> is slave host name\n\t'
+ '<slave_volume_name> is an existing volume name in the '
+ 'slave node',
+ 'start volume geo-replication'
+ )),
+ 'glusterVolumeGeoRepStop': (
+ serv.do_glusterVolumeGeoRepStop,
+ ('masterVolName=<master_volume_name> slaveHost=<slave_host> '
+ 'slaveVolName=<slave_volume_name>\n\t'
+ '<master_volume_name> is an existing volume name in the '
+ 'master node\n\t'
+ '<slave_host> is slave host name\n\t'
+ '<slave_volume_name> is an existing volume name in the '
+ 'slave node',
+ 'stop volume geo-replication'
+ )),
}
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 4bd8308..ed9f5ae 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -287,6 +287,20 @@
status = self.svdsmProxy.glusterServicesGet(serviceNames)
return {'services': status}
+ @exportAsVerb
+ def volumeGeoRepStart(self, masterVolName, slaveHost, slaveVolName,
+ options=None):
+ self.svdsmProxy.glusterVolumeGeoRepStart(masterVolName,
+ slaveHost,
+ slaveVolName)
+
+ @exportAsVerb
+ def volumeGeoRepStop(self, masterVolName, slaveHost, slaveVolName,
+ options=None):
+ self.svdsmProxy.glusterVolumeGeoRepStop(masterVolName,
+ slaveHost,
+ slaveVolName)
+
def getGlusterMethods(gluster):
l = []
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index bac6d1c..e4d6615 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -897,3 +897,29 @@
return _parseVolumeProfileInfo(xmltree, nfs)
except _etreeExceptions:
raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
+
+
+@makePublic
+def volumeGeoRepStart(masterVolName, slaveHost, slaveVolName):
+ command = _getGlusterVolCmd() + ["geo-replication", masterVolName,
+ "%s::%s" % (slaveHost, slaveVolName),
+ "start"]
+ try:
+ _execGlusterXml(command)
+ return True
+ except ge.GlusterCmdFailedException as e:
+ raise ge.GlusterVolumeGeoRepStartFailedException(rc=e.rc,
+ err=e.err)
+
+
+@makePublic
+def volumeGeoRepStop(masterVolName, slaveHost, slaveVolName):
+ command = _getGlusterVolCmd() + ["geo-replication", masterVolName,
+ "%s::%s" % (slaveHost, slaveVolName),
+ "stop"]
+ try:
+ _execGlusterXml(command)
+ return True
+ except ge.GlusterCmdFailedException as e:
+ raise ge.GlusterVolumeGeoRepStopFailedException(rc=e.rc,
+ err=e.err)
diff --git a/vdsm/gluster/exception.py b/vdsm/gluster/exception.py
index c569a9e..259df32 100644
--- a/vdsm/gluster/exception.py
+++ b/vdsm/gluster/exception.py
@@ -484,3 +484,13 @@
prefix = "%s: " % (action)
self.message = prefix + "Service action is not supported"
self.err = [self.message]
+
+
+class GlusterVolumeGeoRepStartFailedException(GlusterVolumeException):
+ code = 4164
+ message = "Volume geo-replication start failed"
+
+
+class GlusterVolumeGeoRepStopFailedException(GlusterVolumeException):
+ code = 4165
+ message = "Volume geo-replication stop failed"
--
To view, visit http://gerrit.ovirt.org/17766
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3cf03c748cf9fe28efe7d407727cd52da20701c5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeyasin(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: vm: Automatically add a serial port for a console device
by Vinzenz Feenstra
Vinzenz Feenstra has uploaded a new change for review.
Change subject: vm: Automatically add a serial port for a console device
......................................................................
vm: Automatically add a serial port for a console device
Without a serial device the console support does not work for
linux systems. We switch from virtio to serial and append a serial
port if a console device was defined.
Change-Id: Ifa7b02a7bcaad63017c35c811a194fa42e2b694f
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 14 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/25979/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 9cb0e82..7ce7c59 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1171,6 +1171,18 @@
commandLine.appendChildWithArgs('qemu:arg', value='keyboard')
self.dom.appendChild(commandLine)
+ def appendSerial(self):
+ """
+ Add a serial port for the console device if it exists
+ <serial type='pty'>
+ <target port='0'>
+ </serial>
+ """
+ if len(self._devices.getElementsByTagName('console')) == 1:
+ s = XMLElement('serial', type='pty')
+ s.appendChildWithArgs('target', port='0')
+ self._devices.appendChild(s)
+
def appendGraphics(self):
"""
Add graphics section to domain xml.
@@ -1888,7 +1900,7 @@
</console>
"""
m = self.createXmlElem('console', 'pty')
- m.appendChildWithArgs('target', type='virtio', port='0')
+ m.appendChildWithArgs('target', type='serial', port='0')
return m
@@ -3025,6 +3037,7 @@
domxml.appendEmulator()
self._appendDevices(domxml)
+ domxml.appendSerial()
for drive in self._devices[DISK_DEVICES][:]:
for leaseElement in drive.getLeasesXML():
--
To view, visit http://gerrit.ovirt.org/25979
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa7b02a7bcaad63017c35c811a194fa42e2b694f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: net_tc: add support for mirroring all (not just IPv4) traffic
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: net_tc: add support for mirroring all (not just IPv4) traffic
......................................................................
net_tc: add support for mirroring all (not just IPv4) traffic
Up until now the filter was only acting on packets with IPv4 headers
because of the 'protocol ip' part of the tc filter. This makes the
mirroring protocol agnostic.
Change-Id: I9de381e67fae4cb79fe41dbd9d1b60b72eb84de4
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm/network/tc.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/88/27388/1
diff --git a/vdsm/network/tc.py b/vdsm/network/tc.py
index 35c4a92..de1837a 100644
--- a/vdsm/network/tc.py
+++ b/vdsm/network/tc.py
@@ -127,7 +127,7 @@
if filt.prio:
command.extend(['prio', filt.prio])
command.extend(['handle', filt.handle])
- command.extend(['protocol', 'ip', 'u32', 'match', 'u8', '0', '0'])
+ command.extend(['protocol', 'all', 'u32', 'match', 'u8', '0', '0'])
for a in filt.actions:
command.extend(['action', 'mirred', 'egress', 'mirror',
'dev', a.target])
@@ -203,7 +203,7 @@
out = _process_request([EXT_TC, 'filter', 'show', 'dev', dev,
'parent', parent])
- HEADER = 'filter protocol ip pref '
+ HEADER = 'filter protocol all pref '
prio = handle = None
actions = []
prevline = ' '
--
To view, visit http://gerrit.ovirt.org/27388
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9de381e67fae4cb79fe41dbd9d1b60b72eb84de4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: gluster: geo replication status and status detail
by dnarayan@redhat.com
Hello Bala.FA,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/18414
to review the following change.
Change subject: gluster: geo replication status and status detail
......................................................................
gluster: geo replication status and status detail
this has two verbs, status: provides geo-replication status of all running
sessions or all sessions associated with a perticular source volume or
session between a source and remote volume. status detail: provides detailed
status of geo-repliction session between source and remote volume
Change-Id: I4f37f35a5480fbe049a67758e122d4a0c2eba513
Signed-off-by: ndarshan <dnarayan(a)redhat.com>
---
M client/vdsClientGluster.py
M vdsm/gluster/api.py
M vdsm/gluster/cli.py
M vdsm/gluster/exception.py
M vdsm/gluster/vdsmapi-gluster-schema.json
5 files changed, 223 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/18414/1
diff --git a/client/vdsClientGluster.py b/client/vdsClientGluster.py
index 90af83e..76a5ba8 100644
--- a/client/vdsClientGluster.py
+++ b/client/vdsClientGluster.py
@@ -424,6 +424,35 @@
pp.pprint(status)
return status['status']['code'], status['status']['message']
+ def do_glusterVolumeGeoRepStatus(self, args):
+ params = self._eqSplit(args)
+ try:
+ volName = params.get('volName', '')
+ remoteHost = params.get('remoteHost', '')
+ remoteVolName = params.get('remoteVolName', '')
+ except:
+ raise ValueError
+ status = self.s.glusterVolumeGeoRepStatus(volName, remoteHost,
+ remoteVolName)
+ pp.pprint(status)
+ return status['status']['code'], status['status']['message']
+
+ def do_glusterVolumeGeoRepStatusDetail(self, args):
+ params = self._eqSplit(args)
+ try:
+ volName = params.get('volName', '')
+ remoteHost = params.get('remoteHost', '')
+ remoteVolName = params.get('remoteVolName', '')
+ except:
+ raise ValueError
+ if not (volName and remoteHost and remoteVolName):
+ raise ValueError
+ status = self.s.glusterVolumeGeoRepStatusDetail(volName,
+ remoteHost,
+ remoteVolName)
+ pp.pprint(status)
+ return status['status']['code'], status['status']['message']
+
def getGlusterCmdDict(serv):
return \
@@ -705,4 +734,24 @@
'not set'
'(swift, glusterd, smb, memcached)'
)),
+ 'glusterVolumeGeoRepStatus': (
+ serv.do_glusterVolumeGeoRepStatus,
+ ('volName=<master_volume_name> '
+ 'remoteHost=<slave_host_name> '
+ 'remoteVolName=<slave_volume_name> '
+ '<master_volume_name>existing volume name in the master node\n\t'
+ '<slave_host_name>is remote slave host name or ip\n\t'
+ '<slave_volume_name>existing volume name in the slave node',
+ 'Returns ths status of geo-replication'
+ )),
+ 'glusterVolumeGeoRepStatusDetail': (
+ serv.do_glusterVolumeGeoRepStatusDetail,
+ ('volName=<master_volume_name> '
+ 'remoteHost=<slave_host_name> '
+ 'remoteVolName=<slave_volume_name> '
+ '<master_volume_name>existing volume name in the master node\n\t'
+ '<slave_host_name>is remote slave host name or ip\n\t'
+ '<slave_volume_name>existing volume name in the slave node',
+ 'Returns the Detailed status of geo-replication'
+ ))
}
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 4bd8308..d24e700 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -287,6 +287,22 @@
status = self.svdsmProxy.glusterServicesGet(serviceNames)
return {'services': status}
+ @exportAsVerb
+ def volumeGeoRepStatus(self, volName=None, remoteHost=None,
+ remoteVolName=None, options=None):
+ status = self.svdsmProxy.glusterVolumeGeoRepStatus(volName,
+ remoteHost,
+ remoteVolName)
+ return {'geo-rep': status}
+
+ @exportAsVerb
+ def volumeGeoRepStatusDetail(self, volName, remoteHost,
+ remoteVolName, options=None):
+ status = self.svdsmProxy.glusterVolumeGeoRepStatusDetail(volName,
+ remoteHost,
+ remoteVolName)
+ return {'geo-rep': status}
+
def getGlusterMethods(gluster):
l = []
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index bac6d1c..1cf0e12 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -897,3 +897,59 @@
return _parseVolumeProfileInfo(xmltree, nfs)
except _etreeExceptions:
raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
+
+
+def _parseGeoRepStatusDetail(tree):
+ status = {'node': tree.find('geoRep/node').text,
+ 'health': tree.find('geoRep/health').text,
+ 'uptime': tree.find('geoRep/uptime').text,
+ 'filesSyncd': tree.find('geoRep/filesSyncd').text,
+ 'filesPending': tree.find('geoRep/filesPending').text,
+ 'bytesPending': tree.find('geoRep/bytesPending').text,
+ 'deletesPending': tree.find('geoRep/deletesPending').text}
+ return status
+
+
+def _parseGeoRepStatus(tree):
+ pairs = []
+ for el in tree.findall('geoRep/pair'):
+ value = {}
+ value['node'] = el.find('node').text
+ value['master'] = el.find('master').text
+ value['slave'] = el.find('slave').text
+ value['health'] = el.find('health').text
+ value['uptime'] = el.find('uptime').text
+ pairs.append(value)
+ return pairs
+
+
+@makePublic
+def volumeGeoRepStatus(volName=None, remoteHost=None, remoteVolName=None,
+ ):
+ command = _getGlusterVolCmd() + ["geo-replication", volName,
+ "%s::%s" % (remoteHost, remoteVolName),
+ "status"]
+ try:
+ xmltree = _execGlusterXml(command)
+ except ge.GlusterCmdFailedException as e:
+ raise ge.GlusterGeoRepStatusFailedException(rc=e.rc, err=e.err)
+ try:
+ return _parseGeoRepStatus(xmltree)
+ except _etreeExceptions:
+ raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
+
+
+@makePublic
+def volumeGeoRepStatusDetail(volName, remoteHost, remoteVolName,
+ ):
+ command = _getGlusterVolCmd() + ["geo-replication", volName,
+ "%s::%s" % (remoteHost, remoteVolName),
+ "status", "detail"]
+ try:
+ xmltree = _execGlusterXml(command)
+ except ge.GlusterCmdFailedException as e:
+ raise ge.GlusterGeoRepStatusDetailFailedException(rc=e.rc, err=e.err)
+ try:
+ return _parseGeoRepStatusDetail(xmltree)
+ except _etreeExceptions:
+ raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
diff --git a/vdsm/gluster/exception.py b/vdsm/gluster/exception.py
index c569a9e..d95b168 100644
--- a/vdsm/gluster/exception.py
+++ b/vdsm/gluster/exception.py
@@ -484,3 +484,19 @@
prefix = "%s: " % (action)
self.message = prefix + "Service action is not supported"
self.err = [self.message]
+
+
+#geo-replication
+class GlusterGeoRepException(GlusterException):
+ code = 4560
+ message = "Gluster Geo-Replication Exception"
+
+
+class GlusterGeoRepStatusFailedException(GlusterGeoRepException):
+ code = 4565
+ message = "Geo Rep status failed"
+
+
+class GlusterGeoRepStatusDetailFailedException(GlusterGeoRepException):
+ code = 4566
+ message = "Geo Rep status detail failed"
diff --git a/vdsm/gluster/vdsmapi-gluster-schema.json b/vdsm/gluster/vdsmapi-gluster-schema.json
index 7a4c034..557c750 100644
--- a/vdsm/gluster/vdsmapi-gluster-schema.json
+++ b/vdsm/gluster/vdsmapi-gluster-schema.json
@@ -372,3 +372,89 @@
{'command': {'class': 'GlusterService', 'name': 'action'},
'data': {'serviceName': 'str', 'action': 'GlusterServiceAction'},
'returns': 'GlusterServicesStatusInfo'}
+
+##
+# @GlusterGeoRepStatus:
+#
+# Gluster geo-replication status information.
+#
+# @node: The node where geo-replication is started
+#
+# @master: The source for geo-replication
+#
+# @slave: The destination of geo-replication
+#
+# @health: The status of the geo-replication session
+#
+# @uptime: The time since the geo-replication started
+#
+# Since: 4.10.3
+##
+{'type': 'GlusterGeoRepStatus',
+ 'data': {'node': 'str', 'master': 'str', 'slave': 'str', 'health': 'str', 'uptime': 'int'}}
+
+
+##
+# @GlusterVolume.geoRepStatus:
+#
+# Gets the status of geo-Replication session
+#
+# @masterVolName: Is an existing volume name in the master node
+#
+# @slaveHost: Is remote slave host name or ip
+#
+# @slaveVolName: Is an available existing volume name in the slave node
+#
+# Returns:
+# status information for geo-replication
+#
+# Since: 4.10.3
+##
+{'command': {'class': 'GlusterVolume', 'name': 'geoRepStatus'},
+ 'data': {'masterVolName': 'str', 'slaveHost': 'str', 'slaveVolName': 'str'},
+ 'returns': 'GlusterGeoRepStatus'}
+
+##
+# @GlusterGeoRepStatusDetail:
+#
+# Gluster geo-replication detailed status information.
+#
+# @node: The node where geo-replication is started
+#
+# @health: The status of the geo-replication session
+#
+# @uptime: The time since the geo-replication started
+#
+# @filesSyncd: The number of files that are synced
+#
+# @filesPending: The number of files that are pending to be synced
+#
+# @bytesPending: The number of bytes that are pending to be synced
+#
+# @deletesPending: The number of deletes that are pending
+#
+# Since: 4.10.3
+##
+{'type': 'GlusterGeoRepStatusDetail',
+ 'data': {'node': 'str', 'health': 'str', 'uptime': 'int', 'filesSyncd': 'int', 'filesPending': 'int',
+ 'bytesPending': 'int','deletesPending': 'int'}}
+
+##
+# @GlusterVolume.geoRepStatusDetail:
+#
+# Gets the detailed status of geo-Replication session
+#
+# @masterVolName: Is an existing volume name in the master node
+#
+# @slaveHost: Is remote slave host name or ip
+#
+# @slaveVolName: Is an available existing volume name in the slave node
+#
+# Returns:
+# detailed status information of geo-replication session
+#
+# Since: 4.10.3
+##
+{'command': {'class': 'GlusterVolume', 'name': 'geoRepStatusDetail'},
+ 'data': {'masterVolName': 'str', 'slaveHost': 'str', 'slaveVolName': 'str'},
+ 'returns': 'GlusterGeoRepStatusDetail'}
--
To view, visit http://gerrit.ovirt.org/18414
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f37f35a5480fbe049a67758e122d4a0c2eba513
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ndarshan <dnarayan(a)redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: configurator: move usermod to spec
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: configurator: move usermod to spec
......................................................................
configurator: move usermod to spec
vdsm-tool configure --force adds to /etc/group (qemu/kvm) sanlock
but doesn't persist the file in ovirt node distro which will
affect vdsm start on next reboot. This patch moves the usermod to
spec file.
Change-Id: I668552fa037414e9a6aee5b049d61749268f85d0
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M lib/vdsm/tool/configurator.py
M vdsm.spec.in
2 files changed, 5 insertions(+), 25 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/26055/1
diff --git a/lib/vdsm/tool/configurator.py b/lib/vdsm/tool/configurator.py
index d1c876c..516a7bc 100644
--- a/lib/vdsm/tool/configurator.py
+++ b/lib/vdsm/tool/configurator.py
@@ -24,7 +24,7 @@
from .. import utils
from . import service, expose
-from ..constants import P_VDSM_EXEC, QEMU_PROCESS_GROUP, VDSM_GROUP
+from ..constants import P_VDSM_EXEC
class _ModuleConfigure(object):
@@ -108,8 +108,6 @@
class SanlockModuleConfigure(_ModuleConfigure):
- SANLOCK_GROUPS = (QEMU_PROCESS_GROUP, VDSM_GROUP)
-
def __init__(self):
super(SanlockModuleConfigure, self).__init__()
@@ -118,28 +116,6 @@
def getServices(self):
return ['sanlock']
-
- def configure(self):
- """
- Configure sanlock process groups
- """
- if os.getuid() != 0:
- raise UserWarning("Must run as root")
-
- rc, out, err = utils.execCmd(
- (
- '/usr/sbin/usermod',
- '-a',
- '-G',
- ','.join(self.SANLOCK_GROUPS),
- 'sanlock'
- ),
- raw=True,
- )
- sys.stdout.write(out)
- sys.stderr.write(err)
- if rc != 0:
- raise RuntimeError("Failed to perform sanlock config.")
def isconfigured(self):
"""
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 361a9c1..b149568 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -690,6 +690,7 @@
/usr/sbin/useradd -r -u 36 -g %{vdsm_group} -d /var/lib/vdsm \
-s /sbin/nologin -c "Node Virtualization Manager" %{vdsm_user}
/usr/sbin/usermod -a -G %{qemu_group},%{snlk_group} %{vdsm_user}
+/usr/sbin/usermod -a -G %{qemu_group},%{vdsm_group} %{snlk_user}
%post
%{_bindir}/vdsm-tool sebool-config || :
@@ -734,6 +735,9 @@
%endif
%preun
+/usr/bin/gpasswd -d %{snlk_user} %{qemu_group}
+/usr/bin/gpasswd -d %{snlk_user} %{vdsm_group}
+
if [ "$1" -eq 0 ]; then
start_conf_section="## beginning of configuration section by vdsm"
end_conf_section="## end of configuration section by vdsm"
--
To view, visit http://gerrit.ovirt.org/26055
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I668552fa037414e9a6aee5b049d61749268f85d0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: vdsm-tool: add the cmd get-engine-web-ca-issuer
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: vdsm-tool: add the cmd get-engine-web-ca-issuer
......................................................................
vdsm-tool: add the cmd get-engine-web-ca-issuer
If oVirt Node is registered via oVirt Engine currently
we don't show to users which engine the node is registered.
This patch extracts the issuer field from engine web ca to use
the CN (commonname) data in ovirt-node-plugin-vdsm.
Change-Id: I70a19f54169498c53cabba0ac75e7a5611762ece
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1039267
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M lib/vdsm/tool/validate_ovirt_certs.py.in
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/27651/1
diff --git a/lib/vdsm/tool/validate_ovirt_certs.py.in b/lib/vdsm/tool/validate_ovirt_certs.py.in
index 6a8c13f..149dc30 100644
--- a/lib/vdsm/tool/validate_ovirt_certs.py.in
+++ b/lib/vdsm/tool/validate_ovirt_certs.py.in
@@ -35,6 +35,7 @@
PATH_CERT = '/etc/pki/vdsm/certs/'
PATH_CACERT = PATH_CERT + 'cacert.pem'
PATH_VDSMCERT = PATH_CERT + 'vdsmcert.pem'
+PATH_ENGINE_WEB_CA = PATH_CERT + 'engine_web_ca.pem'
def is_our_cafile(cacert):
@@ -60,3 +61,17 @@
os.chown(PATH_CACERT, uid, gid)
ovirtfunctions.ovirt_store_config(PATH_CACERT)
break
+
+
+@expose('get-engine-web-ca-issuer')
+def get_engine_web_ca_issuer():
+ """
+ Extract from engine web ca certificate the issuer field
+ """
+ if os.path.exists(PATH_ENGINE_WEB_CA):
+ cmd = [
+ EX_OPENSSL, 'x509', '-in', PATH_ENGINE_WEB_CA, '-noout', '-issuer'
+ ]
+ rc, out, err = execCmd(cmd, raw=True)
+ if not err:
+ print(out),
--
To view, visit http://gerrit.ovirt.org/27651
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I70a19f54169498c53cabba0ac75e7a5611762ece
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: Add man page for vdsm.conf
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: Add man page for vdsm.conf
......................................................................
Add man page for vdsm.conf
Show to user the vdsm.conf options.
Change-Id: Id8e5a47d484fa06070d4566a39cab8a7a53ea717
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M debian/vdsm.install
M vdsm.spec.in
M vdsm/Makefile.am
A vdsm/vdsm.conf.5
4 files changed, 400 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/22891/1
diff --git a/debian/vdsm.install b/debian/vdsm.install
index ef46ed3..0c2b137 100644
--- a/debian/vdsm.install
+++ b/debian/vdsm.install
@@ -31,6 +31,7 @@
./usr/libexec/vdsm/unpersist-vdsm-hook
./usr/libexec/vdsm/vdsm-gencerts.sh
./usr/libexec/vdsm/vdsmd_init_common.sh
+./usr/share/man/man5/vdsm.conf.5
./usr/share/man/man8/vdsmd.8
./usr/share/vdsm/API.py
./usr/share/vdsm/BindingJsonRpc.py
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 385a29b..364997b 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1014,6 +1014,7 @@
%{python_sitelib}/sos/plugins/vdsm.py*
/lib/udev/rules.d/12-vdsm-lvm.rules
/etc/security/limits.d/99-vdsm.conf
+%{_mandir}/man5/vdsm.conf.5*
%{_mandir}/man8/vdsmd.8*
%if 0%{?rhel}
%dir %{_localstatedir}/log/core
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 3834f55..1c1671e 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -89,6 +89,9 @@
vdsm-restore-net-config \
$(NULL)
+dist_man5_MANS = \
+ vdsm.conf.5
+
nodist_man8_MANS = \
vdsmd.8
diff --git a/vdsm/vdsm.conf.5 b/vdsm/vdsm.conf.5
new file mode 100644
index 0000000..98b4ccd
--- /dev/null
+++ b/vdsm/vdsm.conf.5
@@ -0,0 +1,395 @@
+.\"Copyright 2010-2013 Red Hat, Inc. and/or its affiliates.
+.\"
+.\"Licensed to you under the GNU General Public License as published by
+.\"the Free Software Foundation; either version 2 of the License, or
+.\"(at your option) any later version. See the files README and
+.\"LICENSE_GPL_v2 which accompany this distribution.
+.\"
+.\"
+.\" File Name macro definition plagiarized from bash.
+.\"
+.de FN
+\fI\|\\$1\|\fP
+..
+.TH VDSM.CONF 5 "December 6, 2013" "" ""
+.SH NAME
+vdsm.conf \- The configuration file for Virtual Desktops and Servers Manager (VDSM)
+.br
+.SH SYNOPSIS
+.PP
+The
+vdsm\&.conf
+file is a configuration file for VDSM.
+vdsm\&.conf
+contains runtime configuration information for the VDSM\&.
+The complete description of the file format and possible parameters held within are here for reference
+purposes\&.
+.SH "FILE FORMAT"
+.PP
+The file consists of sections and parameters\&. A section begins with the name of the section in square brackets and
+continues until the next section begins\&. Sections contain parameters of the form:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+\fIname\fR = \fIvalue \fR
+.fi
+.if n \{\
+.RE
+.\}
+
+.SH CONFIGURATION BY SECTION (EXAMPLE)
+.PP
+.B [vars]
+
+\fBcore_dump_enable\fR = true
+.br
+Enable core dump
+
+\fBhost_mem_reserve\fR = 256
+.br
+Reserves memory for the host to prevent VMs from using all the physical pages. The values are in Mbytes.
+
+\fBguest_ram_overhead\fR = 65
+
+\fBextra_mem_reserve\fR = 65
+.br
+Memory reserved for non-vds-administered programs.
+
+\fBfake_nics\fR
+.br
+Comma-separated list of fnmatch-patterns for dummy hosts nics to be shown to vdsm.
+
+\fBnic_model\fR = rtl8139,pv
+.br
+NIC model is rtl8139, ne2k_pci pv or any other valid device recognized by kvm/qemu if a coma separated list
+given then a NIC per device will be created.
+
+\fBmigration_timeout\fR = 300
+.br
+Maximum time the destination waits for migration to end. Source waits twice aslong (to avoid races)
+
+\fBmigration_listener_timeout\fR = 30
+.br
+Time to wait (in seconds) for migration destination to start listening before migration begins.
+
+\fBmigration_max_bandwidth\fR = 32
+.br
+Maximum bandwidth for migration, in MiBps, 0 means libvirt's default, since 0.10.x default in libvirt is unlimited
+
+\fBmigration_monitor_intervang\fR = 10
+.br
+How often (in seconds) should the monitor thread pulse, 0 means the thread is disabled
+
+\fBhidden_nics\fR = wlan*,usb*
+.br
+Comma-separated list of fnmatch-patterns for host nics to be hidden from vdsm.
+
+\fBdefault_bridge\fR = engine
+.br
+Default bridge
+
+\fBmigration_downtime\fR = 500
+.br
+Maxmium allowed downtime for live migration in milliseconds (anything below 100ms is ignored) if you do not care about
+liveness of migration, set to a very high value, such as 600000.
+
+\fBmigration_downtime_steps\fR = 10
+.br
+Incremental steps used to reach migration_downtime
+
+\fBmax_outgoing_migrations\fR = 3
+.br
+Maximum concurrent outgoing migrations
+
+\fBsys_shutdown_timeout\fR = 10
+.br
+Destroy and shutdown timeouts (in sec) before completing the action.
+
+\fBuser_shutdown_timeout\fR = 30
+.br
+Grace period (seconds) to let guest user close his applications before shutdown.
+
+\fBguest_agent_timeout\fR = 30
+.br
+Time (in sec) to wait for guest agent.
+
+\fBvm_command_timeout\fR = 60
+.br
+Time to wait (in seconds) for vm to respond to a monitor command, 30 secs is a nice default. Set to 300 if the vm is expected to freeze during cluster failover.
+
+\fBvm_watermark_interval\fR = 2
+.br
+How often should we sample each vm for statistics (seconds).
+
+\fBvm_sample_cpu_interval\fR = 15
+.br
+Interval to collect sampe from CPU
+
+\fBvm_sample_cpu_window\fR = 2
+.br
+Interval to collect from CPU window
+
+\fBvm_sample_disk_interval\fR = 60
+.br
+Interval to collect sample from disk
+
+\fBvm_sample_disk_window\fR = 2
+.br
+Interval to collect disk window
+
+\fBvm_sample_disk_latency_interval\fR = 60
+.br
+Interval to collect disk latency
+
+\fBvm_sample_disk_latency_window\fR = 2
+.br
+Interval to collect disk latency window
+
+\fBvm_sample_net_interval\fR = 5
+.br
+Interval to collect sample from net
+
+\fBvm_sample_net_window\fR = 2
+.br
+Interval to collect sample from net window
+
+\fBtrust_store_path\fR = /etc/pki/vdsm
+.br
+Where the certificates and keys are situated
+
+\fBssl\fR = true
+.br
+Whether to use ssl encryption and authentication.
+
+\fBvds_responsiveness_timeout\fR = 60
+.br
+Responsiveness timeout
+
+\fBvdsm_nice\fR = -5
+.br
+Set vdsm scheduling priority
+
+\fBqemu_drive_cache\fR = none
+.br
+Qemu drive cache
+
+\fBfake_kvm_support\fR = false
+.br
+Emulate kvm support
+
+\fBxmlrpc_enable\fR = true
+.br
+Enable the xmlrpc server
+
+\fBjsonrpc_enable\fR = true
+.br
+Enable the JSON RPC server
+
+\fBreport_host_threads_as_cores\fR = false
+.br
+Count each cpu hyperthread as an individual core
+
+\fBlibvirt_env_variable_log_filters\fR
+.br
+Specify the log filters to track libvirt calls
+
+\fBlibvirt_env_variable_log_outputs\fR
+.br
+Specify the output to track libvirt calls
+
+.B [ksm]
+.br
+\fBksm_monitor_thread\fR = true
+.br
+KSM Monitor
+
+.br
+.B [mom]
+.br
+\fBconf\fR = /etc/vdsm/mom.conf
+.br
+Mom conf file
+.br
+
+.B [irs]
+.br
+\fBirs_enable\fR = true
+.br
+Enable IRS
+
+\fBrepository\fR = path to repository
+.br
+Image Repository
+
+\fBhsm_tasks\fR = (repository)/hsm
+.br
+hsm dir
+
+\fBimages\fR = images/
+.br
+images dir
+
+\fBirsd\fR = (images)/irsd
+.br
+irsd dir
+
+\fBimages_check_times\fR = 0
+.br
+Image repository check period (seconds).
+
+\fBvolume_utilization_percent\fR = 50
+.br
+Volume utilization percent
+
+\fBvolume_utilization_chunk_mb\fR = 1024
+.br
+Volume utilization chunk of mb
+
+\fBvol_size_sample_interval\fR = 60
+.br
+How often should the volume size be checked (seconds).
+
+\fBsd_validate_timeout\fR = 80
+.br
+Storage domain validate timeout, the maximum number of seconds to wait until all the domains will be validated.
+
+\fBscsi_rescan_minimal_timeout\fR = 2
+.br
+The minimum number of seconds to wait for scsi scan to return.
+
+\fBscsi_rescan_maximal_timeout\fR = 30
+.br
+The maximal number of seconds to wait for scsi scan to return.
+
+\fBsd_health_check_delay\fR = 10
+.br
+Storage domain health check delay, the amount of seconds to wait between two successive run of the domain health check.
+
+\fBnfs_mount_options\fR = soft,nosharecache
+.br
+NFS mount options, comma-separated list (NB: no white space allowed!)
+
+\fBpools_data_dir\fR = /var/run/vdsm/pools
+.br
+Pool data dir
+
+\fBvol_extend_policy\fR = ON
+.br
+Volume extend policy
+
+\fBlock_util_path\fR = /usr/libexec/vdsm
+.br
+Block util path
+
+\fBlock_cmd\fR = spmprotect.sh
+.br
+The lock command
+
+\fBfree_lock_cmd\fR = spmstop.sh
+.br
+The free lock command
+
+\fBthread_pool_size\fR = 10
+.br
+Thread pool size
+
+\fBmax_tasks\fR = 500
+.br
+Number max of tasks
+
+\fBlvm_dev_whitelist\fR
+.br
+LVM whitelist
+
+\fBmd_backup_versions\fR = 30
+.br
+Versions of backup
+
+\fBmd_backup_dir\fR = /var/log/vdsm/backup
+.br
+Backup dir
+
+\fBmaximum_allowed_pvs\fR = 8
+.br
+The number of PVs per VG has a hard-coded limit of 10.
+
+\fBrepo_stats_cache_refresh_timeout\fR = 300
+.br
+Repo stats cache refresh
+
+\fBtask_resource_default_timeout\fR = 120000
+.br
+Task resource default timeout
+
+\fBprepare_image_timeout\fR = 600000
+.br
+Prepare image timeout
+
+\fBgc_blocker_force_collect_interval\fR = 60
+.br
+Force collect interval
+
+\fBmaximum_domains_in_pool\fR = 100
+.br
+Process pool configuration.
+
+\fBprocess_pool_size\fR = 100
+.br
+Pool size
+
+\fBprocess_pool_timeout\fR = 60
+.br
+Pool timeout
+
+\fBprocess_pool_grace_period\fR = 2
+.br
+Pool grace period
+
+\fBprocess_pool_max_slots_per_domain\fR = 10
+.br
+Max slots per domain
+
+\fBiscsi_default_ifaces\fR = default
+.br
+Comma seperated ifaces to connect with. i.e. iser,default
+
+\fBuse_volume_leases\fR = false
+.br
+Whether to use the volume leases or not.
+
+.B [address]
+.br
+\fBmanagement_port\fR = 54321
+.br
+Port on which the vdsmd server listens to network clients
+
+\fBss_pool_timeoutjson_port\fR = 4044
+.br
+Port on which the vdsmd Json RPC server listens to network clients
+
+\fBmanagement_ip\fR
+.br
+IP address of management server
+
+\fBguests_gateway_ip\fR
+.br
+Guests gateway IP address
+
+.SH "SEE ALSO"
+.PP
+
+\fBvdsClient\fR(1),
+\fBvdsmd\fR(8)
+
+.SH AUTHOR
+VDSM was written by Ayal Baron, Barak Azulay, Cyril Plisko, Dan Kenigsberg,
+Doron Fediuck, Igor Lvovsky, Saggi Mizrahi, Shahar Frank, Simon Grinberg and
+others.
+
+.SH BUGS
+Report bugs to <http://bugzilla.redhat.com>
+
+.SH COPYRIGHT
+Copyright 2010-2013 Red Hat, Inc. License GPLv2: GNU GPL Version 2 <http://gnu.org/licenses/gpl.html>.
--
To view, visit http://gerrit.ovirt.org/22891
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8e5a47d484fa06070d4566a39cab8a7a53ea717
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: unit_tests: Make run_tests_local.sh not be a generated file
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: unit_tests: Make run_tests_local.sh not be a generated file
......................................................................
unit_tests: Make run_tests_local.sh not be a generated file
It is perfectly possible to simplify run_tests_local.sh.in so that
it does not use macros and this at the same time will allow for
testing subdirectories to use it.
Change-Id: Ie20647b9a7b447b8ed4082f7cefab2146150594e
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
A tests/run_tests_local.sh
D tests/run_tests_local.sh.in
2 files changed, 15 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/27632/1
diff --git a/tests/run_tests_local.sh b/tests/run_tests_local.sh
new file mode 100755
index 0000000..b282c10
--- /dev/null
+++ b/tests/run_tests_local.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+if [ -z "$PYTHON_EXE" ]; then
+ ENV_BIN="/usr/bin/env"
+ PYTHON_EXE="python2"
+fi
+
+# The following line is taken from http://stackoverflow.com/a/246128/206009
+# it sets DIR to the path of the directory that contains this bash script
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ ! -f "$DIR/jsonrpc-tests.server.crt" ] || [ ! -f "$DIR/jsonrpc-tests.server.csr" ] || [ ! -f "$DIR/jsonrpc-tests.server.key" ]; then
+ $DIR/makecert.sh
+fi
+
+PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="$DIR/../lib:$DIR/../vdsm:$DIR/../client:$DIR/../vdsm_api:$PYTHONPATH" $ENV_BIN "$PYTHON_EXE" $DIR/testrunner.py --local-modules $@
diff --git a/tests/run_tests_local.sh.in b/tests/run_tests_local.sh.in
deleted file mode 100644
index 0a229c0..0000000
--- a/tests/run_tests_local.sh.in
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-if [ -z "$PYTHON_EXE" ]; then
- PYTHON_EXE="@PYTHON@"
-fi
-
-if [ ! -f @top_srcdir(a)/tests/jsonrpc-tests.server.crt ] || [ ! -f @top_srcdir(a)/tests/jsonrpc-tests.server.csr ] || [ ! -f @top_srcdir(a)/tests/jsonrpc-tests.server.key ]; then
- @top_srcdir(a)/tests/makecert.sh
-fi
-
-PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="@top_srcdir@/lib:@top_srcdir@/vdsm:@top_srcdir@/client:@top_srcdir@/vdsm_api:$PYTHONPATH" "$PYTHON_EXE" @top_srcdir(a)/tests/testrunner.py --local-modules $@
--
To view, visit http://gerrit.ovirt.org/27632
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie20647b9a7b447b8ed4082f7cefab2146150594e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 5 months