Change in vdsm[master]: remove gluster requirements
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: remove gluster requirements
......................................................................
Patch Set 2:
(2 comments)
https://gerrit.ovirt.org/#/c/41645/2//COMMIT_MSG
Commit Message:
Line 3: AuthorDate: 2015-05-31 16:29:12 +0300
Line 4: Commit: Yaniv Bronhaim <ybronhei(a)redhat.com>
Line 5: CommitDate: 2015-05-31 16:29:12 +0300
Line 6:
Line 7: remove gluster requirements
please provide motivation: support for "hyper convergence"
Line 8:
Line 9: Change-Id: Ia51d9c30538c8f5f6f287c18de8fc2803ac1c76d
https://gerrit.ovirt.org/#/c/41645/2/vdsm.spec.in
File vdsm.spec.in:
Line 292
Line 293
Line 294
Line 295
Line 296
I like to keep this requirement upstream. rhev can skip it with
%if ! 0%{rhev_build}
--
To view, visit https://gerrit.ovirt.org/41645
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia51d9c30538c8f5f6f287c18de8fc2803ac1c76d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
9 years
Change in vdsm[master]: virt: bind console to unix domain socket
by mskrivan@redhat.com
Michal Skrivanek has posted comments on this change.
Change subject: virt: bind console to unix domain socket
......................................................................
Patch Set 7:
@Yaniv: what's your preferred solution to initialize/create that /var/run/ovirt-vmconsole-console directory and permissions?
We'd need to do that on vdsm service startup I guess
--
To view, visit https://gerrit.ovirt.org/40704
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I0a876cd7f3b848aa9dde8123d459dc292729b303
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Vitor de Lima <vdelima(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
9 years
Change in vdsm[master]: virt: bind console to unix domain socket
by mskrivan@redhat.com
Michal Skrivanek has posted comments on this change.
Change subject: virt: bind console to unix domain socket
......................................................................
Patch Set 7: Code-Review+1
--
To view, visit https://gerrit.ovirt.org/40704
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I0a876cd7f3b848aa9dde8123d459dc292729b303
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Vitor de Lima <vdelima(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
9 years
Change in vdsm[master]: vm: Add _findConfDisk() helper
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: vm: Add _findConfDisk() helper
......................................................................
vm: Add _findConfDisk() helper
The new helper eliminate duplicate code looking up a disk in Vm.conf
dict in 3 methods.
Change-Id: Ib3a59a2b798650035870c335ed7c949e2bd431d0
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 21 insertions(+), 25 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/40217/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index ec7ce9c..9e61cc4 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2710,6 +2710,13 @@
raise LookupError("No such drive: '%s'" % drive)
+ def _findConfDisk(self, name):
+ devices = self.conf["devices"][:]
+ for device in devices:
+ if device['type'] == hwclass.DISK and device.get("name") == name:
+ return device
+ raise LookupError("No such disk %r" % name)
+
def updateDriveVolume(self, vmDrive):
if not vmDrive.device == 'disk' or not isVdsmImage(vmDrive):
return
@@ -2741,14 +2748,13 @@
driveParams["name"])
# Updating the VM configuration
- for vmDriveConfig in self.conf["devices"][:]:
- if (vmDriveConfig['type'] == hwclass.DISK and
- vmDriveConfig.get("name") == driveParams["name"]):
- vmDriveConfig.update(driveParams)
- break
- else:
+ try:
+ disk = self._findConfDisk(driveParams["name"])
+ except LookupError:
self.log.error("Unable to update the device configuration ",
- "for: %s", driveParams["name"])
+ "for disk %s", driveParams["name"])
+ else:
+ disk.update(driveParams)
self.saveState()
@@ -3001,15 +3007,10 @@
raise RuntimeError("Disk '%s' already has an ongoing "
"replication" % drive.name)
- for device in self.conf["devices"]:
- if (device['type'] == hwclass.DISK
- and device.get("name") == drive.name):
- with self._confLock:
- device['diskReplicate'] = replica
- self.saveState()
- break
- else:
- raise LookupError("No such drive: '%s'" % drive.name)
+ disk = self._findConfDisk(drive.name)
+ with self._confLock:
+ disk['diskReplicate'] = replica
+ self.saveState()
drive.diskReplicate = replica
@@ -3018,15 +3019,10 @@
This utility method is the inverse of _setDiskReplica, look at the
_setDiskReplica description for more information.
"""
- for device in self.conf["devices"]:
- if (device['type'] == hwclass.DISK
- and device.get("name") == drive.name):
- with self._confLock:
- del device['diskReplicate']
- self.saveState()
- break
- else:
- raise LookupError("No such drive: '%s'" % drive.name)
+ disk = self._findConfDisk(drive.name)
+ with self._confLock:
+ del disk['diskReplicate']
+ self.saveState()
del drive.diskReplicate
--
To view, visit https://gerrit.ovirt.org/40217
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3a59a2b798650035870c335ed7c949e2bd431d0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
9 years
Change in vdsm[master]: dummy: move dummy_if from samplingTests as dummy.device, use...
by osvoboda@redhat.com
Ondřej Svoboda has uploaded a new change for review.
Change subject: dummy: move dummy_if from samplingTests as dummy.device, use in netinfoTests
......................................................................
dummy: move dummy_if from samplingTests as dummy.device, use in netinfoTests
Change-Id: Ibd114b313a08f92503e6e7ba643f3c565a4eaf7b
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M tests/functional/dummy.py
M tests/netinfoTests.py
M tests/samplingTests.py
3 files changed, 24 insertions(+), 24 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/37733/1
diff --git a/tests/functional/dummy.py b/tests/functional/dummy.py
index 9385e45..8594734 100644
--- a/tests/functional/dummy.py
+++ b/tests/functional/dummy.py
@@ -16,6 +16,8 @@
#
# Refer to the README and COPYING files for full details of the license
#
+from contextlib import contextmanager
+
from nose.plugins.skip import SkipTest
from vdsm.ipwrapper import linkAdd, linkDel, addrAdd, linkSet, IPRoute2Error
@@ -53,6 +55,15 @@
(dummy_name, e))
+@contextmanager
+def device(prefix='dummy_', max_length=11):
+ dummy_name = create()
+ try:
+ yield dummy_name
+ finally:
+ remove(dummy_name)
+
+
def setIP(dummy_name, ipaddr, netmask, family=4):
try:
addrAdd(dummy_name, ipaddr, netmask, family)
diff --git a/tests/netinfoTests.py b/tests/netinfoTests.py
index b64cc94..ef4bf64 100644
--- a/tests/netinfoTests.py
+++ b/tests/netinfoTests.py
@@ -182,21 +182,19 @@
with MonkeyPatchScope([(ipwrapper.Link, '_fakeNics', ['veth_*',
'dummy_*'])]):
with veth.pair() as (v1a, v1b):
- d1 = dummy.create()
- fakes = set([d1, v1a, v1b])
- nics = netinfo.nics()
- dummy.remove(d1)
- self.assertTrue(fakes.issubset(nics), 'Fake devices %s are not'
- ' listed in nics %s' % (fakes, nics))
+ with dummy.device() as d1:
+ fakes = set([d1, v1a, v1b])
+ nics = netinfo.nics()
+ self.assertTrue(fakes.issubset(nics), 'Fake devices %s are'
+ ' not listed in nics %s' % (fakes, nics))
with veth.pair(prefix='mehv_') as (v2a, v2b):
- d2 = dummy.create(prefix='mehd_')
- hiddens = set([d2, v2a, v2b])
- dummy.remove(d2)
- nics = netinfo.nics()
- self.assertFalse(hiddens.intersection(nics), 'Some of hidden '
- 'devices %s is shown in nics %s' % (hiddens,
- nics))
+ with dummy.device(prefix='mehd_') as d2:
+ hiddens = set([d2, v2a, v2b])
+ nics = netinfo.nics()
+ self.assertFalse(hiddens.intersection(nics), 'Some of '
+ 'hidden devices %s is shown in nics %s' %
+ (hiddens, nics))
def testGetIfaceCfg(self):
deviceName = "___This_could_never_be_a_device_name___"
diff --git a/tests/samplingTests.py b/tests/samplingTests.py
index 1d0dd4d..3585530 100644
--- a/tests/samplingTests.py
+++ b/tests/samplingTests.py
@@ -112,15 +112,6 @@
@contextmanager
-def dummy_if():
- dummy_name = dummy.create()
- try:
- yield dummy_name
- finally:
- dummy.remove(dummy_name)
-
-
-@contextmanager
def vlan(name, link, vlan_id):
ipwrapper.linkAdd(name, 'vlan', link=link, args=['id', str(vlan_id)])
try:
@@ -150,7 +141,7 @@
hs_before = sampling.HostSample(os.getpid())
interfaces_before = set(hs_before.interfaces.iterkeys())
- with dummy_if() as dummy_name:
+ with dummy.device() as dummy_name:
hs_after = sampling.HostSample(os.getpid())
interfaces_after = set(hs_after.interfaces.iterkeys())
interfaces_diff = interfaces_after - interfaces_before
@@ -167,7 +158,7 @@
with MonkeyPatchScope(
[(ipwrapper, 'getLinks', faultyGetLinks)]):
- with dummy_if() as dummy_name:
+ with dummy.device() as dummy_name:
with vlan(self.NEW_VLAN, dummy_name, 999):
hs = sampling.HostSample(os.getpid())
self.assertNotIn(self.NEW_VLAN, hs.interfaces)
--
To view, visit http://gerrit.ovirt.org/37733
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd114b313a08f92503e6e7ba643f3c565a4eaf7b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
9 years
Change in vdsm[master]: ceph: Support ephemeral Libvirt secrets
by automation@ovirt.org
automation(a)ovirt.org has posted comments on this change.
Change subject: ceph: Support ephemeral Libvirt secrets
......................................................................
Patch Set 23:
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
--
To view, visit https://gerrit.ovirt.org/40712
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2e9ee33a7447ee07b0c82cf5a80d1f9b470663bb
Gerrit-PatchSet: 23
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
9 years
Change in vdsm[master]: ceph: Initial support for network disk
by automation@ovirt.org
automation(a)ovirt.org has posted comments on this change.
Change subject: ceph: Initial support for network disk
......................................................................
Patch Set 14:
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
--
To view, visit https://gerrit.ovirt.org/38766
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1c5792bb6206a227ee0c2df9490b771a69c0093c
Gerrit-PatchSet: 14
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Sahina Bose <sabose(a)redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
9 years
Change in vdsm[master]: ceph: Support ephemeral Libvirt secrets
by automation@ovirt.org
automation(a)ovirt.org has posted comments on this change.
Change subject: ceph: Support ephemeral Libvirt secrets
......................................................................
Patch Set 22:
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
--
To view, visit https://gerrit.ovirt.org/40712
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2e9ee33a7447ee07b0c82cf5a80d1f9b470663bb
Gerrit-PatchSet: 22
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
9 years
Change in vdsm[master]: net: bonding: validate options based on pre-dumped ones
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: net: bonding: validate options based on pre-dumped ones
......................................................................
net: bonding: validate options based on pre-dumped ones
The removed code created a bond device only to check if the provided
options are recongnized by the kernel. This was buggy, as the options
depends on the bonding mode. It was also redundant, as we already depend
on pre-dumped maps of bond options per bond mode, so we can (and should)
use it here, too.
Change-Id: I03fce903280d5eda817e713a51c8079dab9d7649
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/netinfo.py
M tests/netmodelsTests.py
M vdsm/network/api.py
M vdsm/network/models.py
4 files changed, 41 insertions(+), 27 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/41616/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index 8f2c68b..fc08104 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -383,7 +383,7 @@
@memoized
-def _getDefaultBondingOptions(mode=None):
+def getDefaultBondingOptions(mode=None):
"""
Return default options for the given mode. If it is None, return options
for the default mode (usually '0').
@@ -403,7 +403,7 @@
"""
opts = bondOpts(bond)
mode = opts['mode'][-1] if 'mode' in opts else None
- defaults = _getDefaultBondingOptions(mode)
+ defaults = getDefaultBondingOptions(mode)
return dict(((opt, val[-1]) for (opt, val) in opts.iteritems()
if val and val != defaults.get(opt)))
diff --git a/tests/netmodelsTests.py b/tests/netmodelsTests.py
index d005d3d..a271ea5 100644
--- a/tests/netmodelsTests.py
+++ b/tests/netmodelsTests.py
@@ -81,18 +81,17 @@
self.assertEqual(Bond.validateName('bond11'), None)
self.assertEqual(Bond.validateName('bond11128421982'), None)
- @ValidateRunningAsRoot
+ @MonkeyPatch(netinfo, 'BONDING_DEFAULTS', netinfo.BONDING_DEFAULTS
+ if os.path.exists(netinfo.BONDING_DEFAULTS)
+ else '../vdsm/bonding-defaults.json')
def testValidateBondingOptions(self):
- if not os.path.exists(netinfo.BONDING_MASTERS):
- raise SkipTest("bonding kernel module could not be found.")
-
opts = 'mode=802.3ad miimon=150'
badOpts = 'foo=bar badopt=one'
with self.assertRaises(errors.ConfigNetworkError) as cne:
- Bond.validateOptions('bond0', badOpts)
+ Bond.validateOptions(badOpts)
self.assertEqual(cne.exception.errCode, errors.ERR_BAD_BONDING)
- self.assertEqual(Bond.validateOptions('bond0', opts), None)
+ self.assertEqual(Bond.validateOptions(opts), None)
def testIsIpValid(self):
addresses = ('10.18.1.254', '10.50.25.177', '250.0.0.1',
@@ -135,7 +134,6 @@
self.assertEqual(IPv6.validateAddress(address), None)
@MonkeyPatch(netinfo, 'getMtu', lambda *x: 1500)
- @MonkeyPatch(Bond, 'validateOptions', lambda *x: 0)
def testTextualRepr(self):
_netinfo = {'networks': {}, 'vlans': {},
'nics': ['testnic1', 'testnic2'],
@@ -172,7 +170,6 @@
self.assertEqual(inverted, 'mode=4 miimon=250')
@MonkeyPatch(netinfo, 'getMtu', lambda *x: 1500)
- @MonkeyPatch(Bond, 'validateOptions', lambda *x: 0)
def testIterNetworkHierarchy(self):
_netinfo = {'networks': {}, 'vlans': {},
'nics': ['testnic1', 'testnic2'],
diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index 6071f8d..0483d00 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -556,7 +556,7 @@
for bonding, bondingAttrs in bondings.iteritems():
Bond.validateName(bonding)
if 'options' in bondingAttrs:
- Bond.validateOptions(bonding, bondingAttrs['options'])
+ Bond.validateOptions(bondingAttrs['options'])
if bondingAttrs.get('remove', False):
continue
diff --git a/vdsm/network/models.py b/vdsm/network/models.py
index 9aa519e..f4ef33b 100644
--- a/vdsm/network/models.py
+++ b/vdsm/network/models.py
@@ -18,7 +18,6 @@
#
from contextlib import contextmanager
import logging
-import os
import re
import socket
import struct
@@ -214,7 +213,7 @@
if options is None:
self.options = 'mode=802.3ad miimon=150'
else:
- self.validateOptions(name, options)
+ self.validateOptions(options)
self.options = self._reorderOptions(options)
self.destroyOnMasterRemoval = destroyOnMasterRemoval
super(Bond, self).__init__(name, configurator, ipv4, ipv6,
@@ -308,21 +307,39 @@
name)
@classmethod
- def validateOptions(cls, bonding, bondingOptions):
+ def validateOptions(cls, bondingOptions):
'Example: BONDING_OPTS="mode=802.3ad miimon=150"'
- with cls._validationBond(bonding) as bond:
- try:
- for option in bondingOptions.split():
- key, _ = 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)
+ try:
+ mode = '802.3ad'
+ for option in bondingOptions.split():
+ key, value = option.split('=')
+ if key == 'mode':
+ mode = value
+ except ValueError:
+ raise ConfigNetworkError(ne.ERR_BAD_BONDING, 'Error parsing '
+ 'bonding options: %r' %
+ bondingOptions)
+
+ MODE_NAME_TO_NUMBER = {
+ 'balance-rr': '0',
+ 'active-backup': '1',
+ 'balance-xor': '2',
+ 'broadcast': '3',
+ '802.3ad': '4',
+ 'balance-tlb': '5',
+ 'balance-alb': '6',
+ }
+
+ if mode in MODE_NAME_TO_NUMBER:
+ mode = MODE_NAME_TO_NUMBER[mode]
+
+ for option in bondingOptions.split():
+ key, _ = option.split('=')
+
+ if key not in netinfo.getDefaultBondingOptions(mode):
+ raise ConfigNetworkError(ne.ERR_BAD_BONDING, '%r is '
+ 'not a valid bonding option' %
+ key)
@staticmethod
@contextmanager
--
To view, visit https://gerrit.ovirt.org/41616
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I03fce903280d5eda817e713a51c8079dab9d7649
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
9 years
Change in vdsm[master]: vdscli: only write to stderr on plaintext connection given t...
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: vdscli: only write to stderr on plaintext connection given timeout
......................................................................
vdscli: only write to stderr on plaintext connection given timeout
Raising an exception is causing a regression, since previously
we ignored the timeout argument if it was given.
Change-Id: Ief84241e6fe34c8b0f75522458c87c2a5cabaf40
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1223648
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/vdscli.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/84/41384/1
diff --git a/lib/vdsm/vdscli.py b/lib/vdsm/vdscli.py
index c80218d..72c0251 100644
--- a/lib/vdsm/vdscli.py
+++ b/lib/vdsm/vdscli.py
@@ -119,8 +119,8 @@
else:
# TODO: add timeout option for HTTP connection
if timeout is not sslutils.SOCKET_DEFAULT_TIMEOUT:
- raise NotImplementedError('timeout is not supported in'
- ' plaintext connection')
+ sys.stderr.write('timeout is not supported in'
+ ' plaintext connection')
transport = wrap_transport(SingleRequestTransport())
server = xmlrpclib.Server('http://%s' % hostPort, transport)
return server
--
To view, visit https://gerrit.ovirt.org/41384
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief84241e6fe34c8b0f75522458c87c2a5cabaf40
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years