Change in vdsm[master]: NetReload: netmodels for addNetwork
by asegurap@redhat.com
Antoni Segura Puimedon has posted comments on this change.
Change subject: NetReload: netmodels for addNetwork
......................................................................
Patch Set 4: (2 inline comments)
....................................................
File lib/vdsm/netinfo.py
Line 189: return addr
Line 190:
Line 191:
Line 192: def prefix2netmask(prefix):
Line 193: if not 0 <= prefix <= 32:
Move into a previous patch.
Line 194: raise ValueError('%s is not a valid prefix value. It must be between '
Line 195: '0 and 32')
Line 196: return socket.inet_ntoa(
Line 197: struct.pack("!I", int('1' * prefix + '0' * (32 - prefix), 2)))
Line 196: return socket.inet_ntoa(
Line 197: struct.pack("!I", int('1' * prefix + '0' * (32 - prefix), 2)))
Line 198:
Line 199:
Line 200: def netmask2prefix(netmask):
Keep out until a future patch.
Line 201: try:
Line 202: socket.inet_pton(socket.AF_INET, netmask)
Line 203: except socket.error:
Line 204: raise ValueError('%s is not a valid netmask.' % netmask)
--
To view, visit http://gerrit.ovirt.org/14303
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iba5c5b84760e27245cbe34c3b290c54e51278e72
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
10 years, 11 months
Change in vdsm[master]: Supervdsm tests: Fail tests When supervdsm does not start as...
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Supervdsm tests: Fail tests When supervdsm does not start as expected
......................................................................
Supervdsm tests: Fail tests When supervdsm does not start as expected
Checking return value of execCmd when starting supervdsm process. If
errorcode returns, the ut will return as failed.
Change-Id: I33a5564a8e67d70087fef83ae651e8729bdb59a5
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M tests/superVdsmTests.py
1 file changed, 14 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/78/13878/1
diff --git a/tests/superVdsmTests.py b/tests/superVdsmTests.py
index f03a2b7..0a79329 100644
--- a/tests/superVdsmTests.py
+++ b/tests/superVdsmTests.py
@@ -8,7 +8,6 @@
from vdsm import constants
from storage import misc
from monkeypatch import MonkeyPatch
-from time import sleep
@utils.memoized
@@ -31,8 +30,10 @@
self._authkey, str(os.getpid()),
self.pidfile, self.timestamp, self.address,
str(os.getuid())]
- misc.execCmd(superVdsmCmd, sync=False, sudo=True)
- sleep(2)
+ p = misc.execCmd(superVdsmCmd, sync=False, sudo=True)
+ p.wait(3)
+ if p.returncode:
+ raise ("supervdsm is corrupted, executing supervdsmCmd failed")
class TestSuperVdsm(TestCaseBase):
@@ -53,14 +54,21 @@
os.close(fd)
self._proxy.kill() # cleanning old temp files
+ def pingStart(self):
+ try:
+ return self._proxy.ping() # this call initiate svdsm
+ except:
+ # starting svdsm raises exception
+ return False
+
@MonkeyPatch(supervdsm.SuperVdsmProxy, '_start', monkeyStart)
def testIsSuperUp(self):
- self._proxy.ping() # this call initiate svdsm
+ self.assertTrue(self.pingStart())
self.assertTrue(self._proxy.isRunning())
@MonkeyPatch(supervdsm.SuperVdsmProxy, '_start', monkeyStart)
def testKillSuper(self):
- self._proxy.ping()
+ self.assertTrue(self.pingStart())
self._proxy.kill()
self.assertFalse(self._proxy.isRunning())
self._proxy.ping() # Launching vdsm after kill
@@ -68,7 +76,7 @@
@MonkeyPatch(supervdsm.SuperVdsmProxy, '_start', monkeyStart)
def testNoPidFile(self):
- self._proxy.ping() # svdsm is up
+ self.assertTrue(self.pingStart())
self.assertTrue(self._proxy.isRunning())
utils.rmFile(self._proxy.timestamp)
self.assertRaises(IOError, self._proxy.isRunning)
--
To view, visit http://gerrit.ovirt.org/13878
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I33a5564a8e67d70087fef83ae651e8729bdb59a5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
10 years, 11 months
Change in vdsm[master]: vdsm-reg: move OK message to caller.
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: vdsm-reg: move OK message to caller.
......................................................................
vdsm-reg: move OK message to caller.
Due bz#890572 engine.py now calls setVdsConf() to write into vdsm_reg.conf.
However, setVdsConf() prints an 'OK' message used in the old bootstrap and
it's showing in oVirt TUI. This patch will move this OK message to the
caller.
Change-Id: Ifaea56ca3f9f9a4f5e60c684dae9ae1f17f63a1e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=925967
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M vdsm_reg/deployUtil.py.in
M vdsm_reg/vdsm-complete
2 files changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/14393/1
diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in
index 3b056ca..bfd1243 100644
--- a/vdsm_reg/deployUtil.py.in
+++ b/vdsm_reg/deployUtil.py.in
@@ -330,7 +330,6 @@
logging.debug("setVdsConf: saving new config file")
ovirtfunctions.ovirt_store_config(confFile)
- print "<BSTRAP component='VDS Configuration' status='OK'/>"
except Exception as e:
msg = escapeXML(str(e))
print "<BSTRAP component='VDS Configuration' status='FAIL' " \
diff --git a/vdsm_reg/vdsm-complete b/vdsm_reg/vdsm-complete
index 316925e..25ab22e 100755
--- a/vdsm_reg/vdsm-complete
+++ b/vdsm_reg/vdsm-complete
@@ -74,6 +74,7 @@
fOK = deployUtil.setVdsConf(vds_config_str, VDSM_CONF_FILE)
if fOK:
+ print "<BSTRAP component='VDS Configuration' status='OK'/>"
deployUtil.setService("vdsmd", "reconfigure")
reboot(act)
except:
--
To view, visit http://gerrit.ovirt.org/14393
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifaea56ca3f9f9a4f5e60c684dae9ae1f17f63a1e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
10 years, 11 months
Change in vdsm[master]: gluster: move exportToSupervdsm at module level
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/13051
to review the following change.
Change subject: gluster: move exportToSupervdsm at module level
......................................................................
gluster: move exportToSupervdsm at module level
The current exportToSuperVdsm function scope is limited to cli.py.
It's moved to module level. This change enables exportToSuperVdsm
generically.
Change-Id: I5b8217899a637a10c7bc47a13e8afdddc1b0fefe
Signed-off-by: Timothy Asir <tjeyasin(a)redhat.com>
---
M vdsm/gluster/__init__.py
M vdsm/gluster/cli.py
M vdsm/supervdsmServer.py
3 files changed, 26 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/13051/1
diff --git a/vdsm/gluster/__init__.py b/vdsm/gluster/__init__.py
index 1ed02ac..c44d706 100644
--- a/vdsm/gluster/__init__.py
+++ b/vdsm/gluster/__init__.py
@@ -18,6 +18,9 @@
# Refer to the README and COPYING files for full details of the license
#
+
+from functools import wraps
+
GLUSTER_RPM_PACKAGES = (
('glusterfs', 'glusterfs'),
('glusterfs-fuse', 'glusterfs-fuse'),
@@ -38,3 +41,12 @@
('glusterfs-geo-replication', 'libglusterfs0'),
('glusterfs-rdma', 'libglusterfs0'),
('glusterfs-server', 'glusterfs-server'))
+
+
+def exportToSuperVdsm(func):
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ return func(*args, **kwargs)
+
+ wrapper.superVdsm = True
+ return wrapper
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index 13a5694..f04f881 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -25,6 +25,7 @@
from vdsm import netinfo
import exception as ge
from hostname import getHostNameFqdn, HostNameException
+from . import exportToSuperVdsm
_glusterCommandPath = utils.CommandPath("gluster",
"/usr/sbin/gluster",
@@ -43,15 +44,6 @@
def _getGlusterPeerCmd():
return [_glusterCommandPath.cmd, "--mode=script", "peer"]
-
-
-def exportToSuperVdsm(func):
- @wraps(func)
- def wrapper(*args, **kwargs):
- return func(*args, **kwargs)
-
- wrapper.superVdsm = True
- return wrapper
class BrickStatus:
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index d905201..9c0482e 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -342,17 +342,20 @@
def main():
- def bind(func):
- def wrapper(_SuperVdsm, *args, **kwargs):
- return func(*args, **kwargs)
- return wrapper
+ def bindToSuperVdsm(module):
+ def bind(func):
+ def wrapper(_SuperVdsm, *args, **kwargs):
+ return func(*args, **kwargs)
+ return wrapper
- for name in dir(gcli):
- func = getattr(gcli, name)
- if getattr(func, 'superVdsm', False):
- setattr(_SuperVdsm,
- 'gluster%s%s' % (name[0].upper(), name[1:]),
- logDecorator(bind(func)))
+ for name in dir(module):
+ func = getattr(module, name)
+ if getattr(func, 'superVdsm', False):
+ setattr(_SuperVdsm,
+ 'gluster%s%s' % (name[0].upper(), name[1:]),
+ logDecorator(bind(func)))
+
+ bindToSuperVdsm(gcli)
try:
logging.config.fileConfig(LOG_CONF_PATH)
--
To view, visit http://gerrit.ovirt.org/13051
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b8217899a637a10c7bc47a13e8afdddc1b0fefe
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>
10 years, 11 months