Change in vdsm[ovirt-3.2]: bootstrap: remove glusterfs packages
by barumuga@redhat.com
Hello Timothy Asir, Saggi Mizrahi, Aravinda VK, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/12959
to review the following change.
Change subject: bootstrap: remove glusterfs packages
......................................................................
bootstrap: remove glusterfs packages
As glusterfs packages are dependencies for vdsm-gluster package,
having these in bootstrap is redundant
Change-Id: I5bdde338599155df43af3a0fd0d14a02e3bddda8
Signed-off-by: Bala.FA <barumuga(a)redhat.com>
---
M vds_bootstrap/vds_bootstrap.py
M vdsm.spec.in
2 files changed, 5 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/12959/1
diff --git a/vds_bootstrap/vds_bootstrap.py b/vds_bootstrap/vds_bootstrap.py
index 61e0f6f..219e6e4 100755
--- a/vds_bootstrap/vds_bootstrap.py
+++ b/vds_bootstrap/vds_bootstrap.py
@@ -159,8 +159,7 @@
'seabios', 'qemu-img', 'fence-agents',
'libselinux-python', 'sanlock', 'sanlock-python')
# Gluster packages
- GLUSTER_PACK = ('vdsm-gluster', 'glusterfs-server', 'glusterfs-rdma',
- 'glusterfs-geo-replication')
+ GLUSTER_PACK = (VDSM_NAME + '-gluster', )
else:
# Devel packages
DEVEL_PACK = ('gdb', 'tcpdump', 'strace', 'ltrace', 'sysstat', 'ntp',
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 0aad124..1cb189e 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -402,7 +402,10 @@
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
-Requires: glusterfs glusterfs-server glusterfs-fuse
+Requires: glusterfs
+Requires: glusterfs-server
+Requires: glusterfs-fuse
+Requires: glusterfs-rdma
%description gluster
Gluster plugin enables VDSM to serve Gluster functionalities.
--
To view, visit http://gerrit.ovirt.org/12959
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bdde338599155df43af3a0fd0d14a02e3bddda8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Aravinda VK <avishwan(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin(a)redhat.com>
11 years, 2 months
Change in vdsm[ovirt-3.2]: gluster: Handling Attribute error in Python 2.6
by avishwan@redhat.com
Aravinda VK has uploaded a new change for review.
Change subject: gluster: Handling Attribute error in Python 2.6
......................................................................
gluster: Handling Attribute error in Python 2.6
xml.etree.cElementTree in Python 2.6 doesn't have the attribute
ParseError(Introduced in Python 2.7). VDSM gluster/cli.py tries
to capture etree.ParseError when gluster cli returns incompatible
xml output.
Change-Id: I63c33b34ce11473636365ea094e267c5424c7255
Signed-off-by: Aravinda VK <avishwan(a)redhat.com>
(cherry picked from commit 5759c876e414b433b1a42e50e1817d5841ec2ef2)
---
M vdsm/gluster/cli.py
1 file changed, 12 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/12829/1
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index 7136281..d4f65ab 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -31,6 +31,12 @@
)
+if hasattr(etree, 'ParseError'):
+ _etreeExceptions = (etree.ParseError, AttributeError, ValueError)
+else:
+ _etreeExceptions = (SyntaxError, AttributeError, ValueError)
+
+
def _getGlusterVolCmd():
return [_glusterCommandPath.cmd, "--mode=script", "volume"]
@@ -85,7 +91,7 @@
tree = etree.fromstring('\n'.join(out))
rv = int(tree.find('opRet').text)
msg = tree.find('opErrstr').text
- except (etree.ParseError, AttributeError, ValueError):
+ except _etreeExceptions:
raise ge.GlusterXmlErrorException(err=out)
if rv == 0:
return tree
@@ -303,7 +309,7 @@
return _parseVolumeStatusMem(xmltree)
else:
return _parseVolumeStatus(xmltree)
- except (etree.ParseError, AttributeError, ValueError):
+ except _etreeExceptions:
raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
@@ -427,7 +433,7 @@
raise ge.GlusterVolumesListFailedException(rc=e.rc, err=e.err)
try:
return _parseVolumeInfo(xmltree)
- except (etree.ParseError, AttributeError, ValueError):
+ except _etreeExceptions:
raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
@@ -448,7 +454,7 @@
raise ge.GlusterVolumeCreateFailedException(rc=e.rc, err=e.err)
try:
return {'uuid': xmltree.find('volCreate/volume/id').text}
- except (etree.ParseError, AttributeError, ValueError):
+ except _etreeExceptions:
raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
@@ -787,7 +793,7 @@
return _parsePeerStatus(xmltree,
_getLocalIpAddress() or _getGlusterHostName(),
_getGlusterUuid(), HostStatus.CONNECTED)
- except (etree.ParseError, AttributeError, ValueError):
+ except _etreeExceptions:
raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
@@ -878,5 +884,5 @@
raise ge.GlusterVolumeProfileInfoFailedException(rc=e.rc, err=e.err)
try:
return _parseVolumeProfileInfo(xmltree, nfs)
- except (etree.ParseError, AttributeError, ValueError):
+ except _etreeExceptions:
raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
--
To view, visit http://gerrit.ovirt.org/12829
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I63c33b34ce11473636365ea094e267c5424c7255
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Aravinda VK <avishwan(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: gluster: set glusterfs dependency version
by barumuga@redhat.com
Hello Timothy Asir, Saggi Mizrahi, Aravinda VK, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/13006
to review the following change.
Change subject: gluster: set glusterfs dependency version
......................................................................
gluster: set glusterfs dependency version
Now vdsm-gluster depends on glusterfs version 3.4.0 or higher.
Change-Id: Icb42bf4dec26b118f52cc51701faa5e611f63c00
Signed-off-by: Bala.FA <barumuga(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/06/13006/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 48d8d69..6c8dbcd 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -433,7 +433,7 @@
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
-Requires: glusterfs
+Requires: glusterfs >= 3.4.0
Requires: glusterfs-server
Requires: glusterfs-fuse
Requires: glusterfs-rdma
--
To view, visit http://gerrit.ovirt.org/13006
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb42bf4dec26b118f52cc51701faa5e611f63c00
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Aravinda VK <avishwan(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: getVdsCaps verb is updated to provide glusterfs package info...
by tjeyasin@redhat.com
Hello Ayal Baron, Bala.FA, Saggi Mizrahi, Federico Simoncelli, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/11138
to review the following change.
Change subject: getVdsCaps verb is updated to provide glusterfs package info along with other key package details.
......................................................................
getVdsCaps verb is updated to provide glusterfs package info along
with other key package details.
Change-Id: I38991550e57c8f1e558f297cf12d984f7f0bc635
Signed-off-by: Timothy Asir <tjeyasin(a)redhat.com>
---
M vdsm/caps.py
1 file changed, 25 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/11138/1
diff --git a/vdsm/caps.py b/vdsm/caps.py
index a307200..125f30c 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -329,12 +329,21 @@
pkgs = {'kernel': kernelDict()}
if getos() in (OSName.RHEVH, OSName.OVIRT, OSName.FEDORA, OSName.RHEL):
+ GLUSTER_PACKAGES = ['glusterfs', 'glusterfs-debuginfo',
+ 'glusterfs-devel', 'glusterfs-fuse',
+ 'glusterfs-geo-replication', 'glusterfs-rdma',
+ 'glusterfs-server', 'glusterfs-swift',
+ 'glusterfs-swift-account',
+ 'glusterfs-swift-container', 'glusterfs-swift-doc',
+ 'glusterfs-swift-object', 'glusterfs-swift-proxy',
+ 'glusterfs-ufo']
KEY_PACKAGES = ['qemu-kvm', 'qemu-img',
'vdsm', 'spice-server', 'libvirt', 'mom']
try:
ts = rpm.TransactionSet()
+ KEY_PACKAGES += GLUSTER_PACKAGES
for pkg in KEY_PACKAGES:
try:
mi = ts.dbMatch('name', pkg).next()
@@ -350,12 +359,28 @@
logging.error('', exc_info=True)
elif getos() == OSName.DEBIAN and python_apt:
+ GLUSTER_PACKAGES = {
+ 'gluster-swift-plugin': 'glusterfs-ufo',
+ 'gluster-swift-account': 'glusterfs-swift-account',
+ 'gluster-swift-doc': 'glusterfs-swift-doc',
+ 'gluster-swift-object': 'glusterfs-swift-object',
+ 'gluster-swift-container': 'glusterfs-swift-container',
+ 'gluster-swift': 'glusterfs-swift',
+ 'gluster-swift-proxy': 'glusterfs-swift-proxy',
+ 'glusterfs': 'glusterfs',
+ 'glusterfs-debuginfo': 'glusterfs-debuginfo',
+ 'glusterfs-devel': 'glusterfs-devel',
+ 'glusterfs-fuse': 'glusterfs-fuse',
+ 'glusterfs-geo-replication': 'glusterfs-geo-replication',
+ 'glusterfs-rdma': 'glusterfs-rdma',
+ 'glusterfs-server': 'glusterfs-server'}
KEY_PACKAGES = {'qemu-kvm': 'qemu-kvm', 'qemu-img': 'qemu-utils',
'vdsm': 'vdsmd', 'spice-server': 'libspice-server1',
'libvirt': 'libvirt0', 'mom': 'mom'}
cache = apt.Cache()
+ KEY_PACKAGES.update(GLUSTER_PACKAGES)
for pkg in KEY_PACKAGES:
try:
deb_pkg = KEY_PACKAGES[pkg]
--
To view, visit http://gerrit.ovirt.org/11138
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I38991550e57c8f1e558f297cf12d984f7f0bc635
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: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: Fix mbx Exception type.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Fix mbx Exception type.
......................................................................
Fix mbx Exception type.
Change-Id: Id8baf1121aaf351b029945972d5e87dbfa6a0bd5
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/storage_mailbox.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/6617/1
--
To view, visit http://gerrit.ovirt.org/6617
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8baf1121aaf351b029945972d5e87dbfa6a0bd5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: Fix races in sd.createMasterDir()
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Fix races in sd.createMasterDir()
......................................................................
Fix races in sd.createMasterDir()
Change-Id: I6a79b620853663bc7ab7e33633bd6dc9f67759e6
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/sd.py
M vdsm/storage/sp.py
2 files changed, 9 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/06/12806/1
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 9ce836b..48ee7d5 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -601,20 +601,16 @@
return vmsInfo
- def createMasterTree(self, log=False):
+ def createMasterTree(self):
"""
+ Make tasks and vms directories on master directory.
"""
- # Build new 'master' tree
- pdir = self.getVMsDir()
- if not os.path.exists(pdir):
- if log:
- self.log.warning("vms dir not found, creating (%s)" % pdir)
- os.makedirs(pdir) # FIXME remove if not a pdir
- pdir = self.getTasksDir()
- if not os.path.exists(pdir):
- if log:
- self.log.warning("tasks dir not found, creating (%s)" % pdir)
- os.makedirs(pdir)
+ vmsDir = self.getVMsDir()
+ self.log.debug("creating vms dir: %s" % vmsDir)
+ self.oop.fileUtils.createdir(vmsDir)
+ tasksDir = self.getTasksDir()
+ self.log.debug("creating task dir: %s" % tasksDir)
+ self.oop.fileUtils.createdir(tasksDir)
def activate(self):
"""
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 7a64bf5..516d3fe 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -291,7 +291,7 @@
self._upgradePool(expectedDomVersion, __securityOverride=True)
self.masterDomain.mountMaster()
- self.masterDomain.createMasterTree(log=True)
+ self.masterDomain.createMasterTree()
self.tasksDir = os.path.join(self.poolPath, POOL_MASTER_DOMAIN,
sd.MASTER_FS_DIR, sd.TASKS_DIR)
--
To view, visit http://gerrit.ovirt.org/12806
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a79b620853663bc7ab7e33633bd6dc9f67759e6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: define qemu process user and group in configure.ac for Ubunt...
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: define qemu process user and group in configure.ac for Ubuntu
......................................................................
define qemu process user and group in configure.ac for Ubuntu
Ubuntu qemu process started by libvirt is libvirt-qemu:kvm, and there
is no group named qemu, only group kvm. This patch sets the correct
value of the variable in configure.ac .
The patch is on going work of porting VDSM to Ubuntu
http://www.ovirt.org/VDSM_on_Ubuntu
Change-Id: I78392b4edcf243e8a2d65b8b18436141e3ed86ea
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M configure.ac
1 file changed, 10 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/12915/1
diff --git a/configure.ac b/configure.ac
index 434d209..9aeeb56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,8 +59,16 @@
AC_SUBST([VDSMGROUP], [kvm])
AC_SUBST([METADATAUSER], [vdsm])
AC_SUBST([METADATAGROUP], [kvm])
-AC_SUBST([QEMUUSER], [qemu])
-AC_SUBST([QEMUGROUP], [qemu])
+if grep -i fedora /etc/*-release; then
+ AC_SUBST([QEMUUSER], [qemu])
+ AC_SUBST([QEMUGROUP], [qemu])
+elif grep -i ubuntu /etc/*-release; then
+ AC_SUBST([QEMUUSER], [libvirt-qemu])
+ AC_SUBST([QEMUGROUP], [kvm])
+else
+ AC_SUBST([QEMUUSER], [qemu])
+ AC_SUBST([QEMUGROUP], [qemu])
+fi
AC_SUBST([SNLKUSER], [sanlock])
AC_SUBST([SNLKGROUP], [sanlock])
--
To view, visit http://gerrit.ovirt.org/12915
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I78392b4edcf243e8a2d65b8b18436141e3ed86ea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
11 years, 2 months
Change in vdsm[master]: Removed glusterfs packages from bootstrap
by barumuga@redhat.com
Hello Ayal Baron, Timothy Asir, Saggi Mizrahi, Federico Simoncelli, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/9076
to review the following change.
Change subject: Removed glusterfs packages from bootstrap
......................................................................
Removed glusterfs packages from bootstrap
As glusterfs packages are dependencies for vdsm-gluster package,
having these in bootstrap is redundant
Change-Id: I5bdde338599155df43af3a0fd0d14a02e3bddda8
Signed-off-by: Bala.FA <barumuga(a)redhat.com>
---
M vds_bootstrap/vds_bootstrap.py
M vdsm.spec.in
2 files changed, 2 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/9076/1
diff --git a/vds_bootstrap/vds_bootstrap.py b/vds_bootstrap/vds_bootstrap.py
index 867d6f4..95f255d 100755
--- a/vds_bootstrap/vds_bootstrap.py
+++ b/vds_bootstrap/vds_bootstrap.py
@@ -159,8 +159,7 @@
'seabios', 'qemu-img', 'fence-agents',
'libselinux-python', 'sanlock', 'sanlock-python')
# Gluster packages
- GLUSTER_PACK = ('vdsm-gluster', 'glusterfs-server', 'glusterfs-rdma',
- 'glusterfs-geo-replication')
+ GLUSTER_PACK = (VDSM_NAME+'-gluster')
else:
# Devel packages
DEVEL_PACK = ('gdb','tcpdump','strace','ltrace','sysstat','ntp',
diff --git a/vdsm.spec.in b/vdsm.spec.in
index c117ee5..8070cbe 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -356,7 +356,7 @@
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
-Requires: glusterfs glusterfs-server glusterfs-fuse
+Requires: glusterfs, glusterfs-server, glusterfs-fuse, glusterfs-rdma
%description gluster
Gluster plugin enables VDSM to serve Gluster functionalities.
--
To view, visit http://gerrit.ovirt.org/9076
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bdde338599155df43af3a0fd0d14a02e3bddda8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: Fix checking bonding options for missing bonds.
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: Fix checking bonding options for missing bonds.
......................................................................
Fix checking bonding options for missing bonds.
Right up until now, we were checking the options for a bond A
that would have to be potentially created by checking for the
existance of /sys/class/net/A/bonding/<opt>. Obviously, if the
bond had not been created at that point, the option validation
would fail.
This patch makes the option validation be done on whichever bond
is present on the system and, if none are, it creates the bond
to check the options.
Change-Id: I023a5bb8a52719559bb9d4716f25e0cba8b3530b
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/649239
---
M vdsm/configNetwork.py
1 file changed, 34 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/12701/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index f245af1..dedcaf3 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -27,6 +27,7 @@
import logging
import threading
from xml.sax.saxutils import escape
+from contextlib import contextmanager
import glob
import socket
import shutil
@@ -47,6 +48,8 @@
MAX_BRIDGE_NAME_LEN = 15
ILLEGAL_BRIDGE_CHARS = frozenset(':. \t')
DEFAULT_MTU = '1500'
+
+BONDING_MASTERS = '/sys/class/net/bonding_masters'
class ConfigNetworkError(Exception):
@@ -493,9 +496,8 @@
bootproto, mtu, onboot, **kwargs)
# create the bonding device to avoid initscripts noise
- bondMastersPath = '/sys/class/net/bonding_masters'
- if bonding not in open(bondMastersPath).read().split():
- open(bondMastersPath, 'w').write('+%s\n' % bonding)
+ if bonding not in open(BONDING_MASTERS).read().split():
+ open(BONDING_MASTERS, 'w').write('+%s\n' % bonding)
def addNic(self, nic, bonding=None, bridge=None, mtu=None,
ipaddr=None, netmask=None, gateway=None, bootproto=None,
@@ -727,16 +729,36 @@
def validateBondingOptions(bonding, bondingOptions):
'Example: BONDING_OPTS="mode=802.3ad miimon=150"'
+ with validationBond(bonding) as bond:
+ try:
+ for option in bondingOptions.split():
+ key, value = option.split('=')
+ if not os.path.exists(
+ '/sys/class/net/%s/bonding/%s' % (bond, key)):
+ raise ConfigNetworkError(ne.ERR_BAD_BONDING, '%r is not a '
+ 'valid bonding option' % key)
+ except ValueError:
+ raise ConfigNetworkError(ne.ERR_BAD_BONDING, 'Error parsing '
+ 'bonding options: %r' % bondingOptions)
+
+
+@contextmanager
+def validationBond(bonding):
+ bond_created = False
try:
- for option in bondingOptions.split():
- key, value = option.split('=')
- if not os.path.exists(
- '/sys/class/net/%(bonding)s/bonding/%(key)s' % locals()):
- raise ConfigNetworkError(ne.ERR_BAD_BONDING, '%r is not a '
- 'valid bonding option' % key)
- except ValueError:
- raise ConfigNetworkError(ne.ERR_BAD_BONDING, 'Error parsing bonding '
- 'options: %r' % bondingOptions)
+ bonding = open(BONDING_MASTERS, 'r').read().split()[0]
+ except IndexError:
+ open(BONDING_MASTERS, 'w').write('+%s\n' % bonding)
+ bond_created = True
+ try:
+ yield bonding
+ except Exception:
+ if bond_created:
+ try:
+ open(BONDING_MASTERS, 'w').write('-%s\n' % bonding)
+ except IOError:
+ pass
+ raise
def validateVlanId(vlan):
--
To view, visit http://gerrit.ovirt.org/12701
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I023a5bb8a52719559bb9d4716f25e0cba8b3530b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: storageServer: fix spelling
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: storageServer: fix spelling
......................................................................
storageServer: fix spelling
Change-Id: Ifce5b76392e77e6f792f37f56096927a2273f7b0
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/storage/storageServer.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/12943/1
diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py
index 6f317ee..e36859b 100644
--- a/vdsm/storage/storageServer.py
+++ b/vdsm/storage/storageServer.py
@@ -508,7 +508,7 @@
return hash(type(self)) ^ hash(self._path)
-class IlligalAliasError(RuntimeError):
+class IllegalAliasError(RuntimeError):
pass
@@ -554,7 +554,7 @@
def _getConnectionFile(self, alias):
if "/" in alias:
- raise IlligalAliasError(alias)
+ raise IllegalAliasError(alias)
try:
os.makedirs(self._persistDir)
--
To view, visit http://gerrit.ovirt.org/12943
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifce5b76392e77e6f792f37f56096927a2273f7b0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
11 years, 2 months