Change in vdsm[master]: pep8 fix of contrib vds_bootstrap and vdsm_reg.
by asegurap@redhat.com
Antoni Segura Puimedon has posted comments on this change.
Change subject: pep8 fix of contrib vds_bootstrap and vdsm_reg.
......................................................................
Patch Set 1: (2 inline comments)
Thanks for the review!
....................................................
File vdsm_reg/deployUtil.py.in
Line 620:
Line 621: nReturn = 0
Line 622: out = None
Line 623: err = None
Line 624: if isinstance(srvName, None):
Great catch! This happens to me for following the flake8 recommendation :P
Line 625: nReturn = 1
Line 626: message = "setService: ignoring None service."
Line 627: err = message
Line 628: logging.error(message)
Line 1482:
Line 1483: msr = _prdmsr(0, MSR_IA32_FEATURE_CONTROL)
Line 1484: return (msr & (MSR_IA32_FEATURE_CONTROL_LOCKED |
Line 1485: MSR_IA32_FEATURE_CONTROL_VMXON_ENABLED)) != \
Line 1486: MSR_IA32_FEATURE_CONTROL_LOCKED
Right! Done!
Line 1487:
Line 1488:
Line 1489: def _cpu_has_svm_support():
Line 1490: SVM_CPUID_FEATURE_SHIFT = 2
--
To view, visit http://gerrit.ovirt.org/10771
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I44b1bc34c65fc67a04c11ba7d7c49d57f3cc4811
Gerrit-PatchSet: 1
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: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
11 years, 5 months
Change in vdsm[master]: pep8 fix of contrib vds_bootstrap and vdsm_reg.
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has posted comments on this change.
Change subject: pep8 fix of contrib vds_bootstrap and vdsm_reg.
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(2 inline comments)
....................................................
File vdsm_reg/deployUtil.py.in
Line 620:
Line 621: nReturn = 0
Line 622: out = None
Line 623: err = None
Line 624: if isinstance(srvName, None):
This would explode. It should be
import types
if isinstance(srvName types.NoneType):
but in fact we can just write
if srvName is None:
Line 625: nReturn = 1
Line 626: message = "setService: ignoring None service."
Line 627: err = message
Line 628: logging.error(message)
Line 1482:
Line 1483: msr = _prdmsr(0, MSR_IA32_FEATURE_CONTROL)
Line 1484: return (msr & (MSR_IA32_FEATURE_CONTROL_LOCKED |
Line 1485: MSR_IA32_FEATURE_CONTROL_VMXON_ENABLED)) != \
Line 1486: MSR_IA32_FEATURE_CONTROL_LOCKED
I think it should be
return (msr & (MSR_IA32_FEATURE_CONTROL_LOCKED |
MSR_IA32_FEATURE_CONTROL_VMXON_ENABLED)) != \
MSR_IA32_FEATURE_CONTROL_LOCKED
I mean MSR_IA32_FEATURE_CONTROL_VMXON_ENABLED should align with MSR_IA32_FEATURE_CONTROL_LOCKED in the upper line, since they a in the same level.
Line 1487:
Line 1488:
Line 1489: def _cpu_has_svm_support():
Line 1490: SVM_CPUID_FEATURE_SHIFT = 2
--
To view, visit http://gerrit.ovirt.org/10771
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I44b1bc34c65fc67a04c11ba7d7c49d57f3cc4811
Gerrit-PatchSet: 1
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: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
11 years, 5 months
Change in vdsm[master]: Remove duplicate implementation of tobool
by wudxw@linux.vnet.ibm.com
Mark Wu has uploaded a new change for review.
Change subject: Remove duplicate implementation of tobool
......................................................................
Remove duplicate implementation of tobool
This patch removes the duplicate tobool function from hooking.py,
and replace the usage of it with utils.tobool.
Also make hooking.py pep8 clean.
Change-Id: Ie0d382dabc9df68139070e8ac10f84ba1ca3774b
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M Makefile.am
M vdsm/hooking.py
M vdsm_hooks/vhostmd/after_vm_destroy.py
M vdsm_hooks/vhostmd/before_vm_start.py
4 files changed, 6 insertions(+), 15 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/8446/1
diff --git a/Makefile.am b/Makefile.am
index 7548f42..26ce956 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,6 +59,7 @@
vdsm/gluster/exception.py \
vdsm/gluster/hostname.py \
vdsm/guestIF.py \
+ vdsm/hooking.py \
vdsm/hooks.py \
vdsm/libvirtev.py \
vdsm/libvirtvm.py \
diff --git a/vdsm/hooking.py b/vdsm/hooking.py
index a324311..714e046 100644
--- a/vdsm/hooking.py
+++ b/vdsm/hooking.py
@@ -42,21 +42,10 @@
from storage.misc import execCmd
execCmd # make pyflakes happy
-def tobool(s):
- """Convert the argument into a boolean"""
- try:
- if s == None:
- return False
- if type(s) == bool:
- return s
- if s.lower() == 'true':
- return True
- return bool(int(s))
- except:
- return False
def read_domxml():
return minidom.parseString(file(os.environ['_hook_domxml']).read())
+
def write_domxml(domxml):
file(os.environ['_hook_domxml'], 'w').write(domxml.toxml(encoding='utf-8'))
diff --git a/vdsm_hooks/vhostmd/after_vm_destroy.py b/vdsm_hooks/vhostmd/after_vm_destroy.py
index c129ded..7c505de 100644
--- a/vdsm_hooks/vhostmd/after_vm_destroy.py
+++ b/vdsm_hooks/vhostmd/after_vm_destroy.py
@@ -21,7 +21,7 @@
import os
import subprocess
-import hooking
+from vdsm import utils
from vdsm import vdscli
s = vdscli.connect()
@@ -30,6 +30,6 @@
if res['status']['code'] == 0:
if not [v for v in res['vmList']
if v.get('vmId') != os.environ.get('vmId') and
- hooking.tobool(v.get('custom', {}).get('sap_agent', False))]:
+ utils.tobool(v.get('custom', {}).get('sap_agent', False))]:
subprocess.call(['/usr/bin/sudo', '-n', '/sbin/service', 'vhostmd',
'stop'])
diff --git a/vdsm_hooks/vhostmd/before_vm_start.py b/vdsm_hooks/vhostmd/before_vm_start.py
index 47d0d0d..7e38a7f 100644
--- a/vdsm_hooks/vhostmd/before_vm_start.py
+++ b/vdsm_hooks/vhostmd/before_vm_start.py
@@ -22,9 +22,10 @@
import os
import subprocess
import hooking
+from vdsm import utils
-if hooking.tobool(os.environ.get('sap_agent', False)):
+if utils.tobool(os.environ.get('sap_agent', False)):
domxml = hooking.read_domxml()
subprocess.call(['/usr/bin/sudo', '-n', '/sbin/service', 'vhostmd',
--
To view, visit http://gerrit.ovirt.org/8446
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0d382dabc9df68139070e8ac10f84ba1ca3774b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
11 years, 5 months
Change in vdsm[master]: Redirect stderr to syslog prints
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Redirect stderr to syslog prints
......................................................................
Redirect stderr to syslog prints
Otherwise, assert statements won't appear in syslog, and it allows
reporting if vdsm log file is corrupted.
Change-Id: Icbdc151f174223e7b54e9dec221c3cd2868b536d
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/vdsm
1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/9822/1
diff --git a/vdsm/vdsm b/vdsm/vdsm
index 8df24fb..238dd94 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -10,6 +10,7 @@
import os
import sys
+import syslog
import getopt
import signal
import getpass
@@ -31,6 +32,17 @@
loggerConfFile = constants.P_VDSM_CONF + 'logger.conf'
+# redirect strerr to syslog
+class syslogPrinter(object):
+
+ syslog.openlog('vdsm')
+
+ def write(self, data):
+ syslog.syslog(data)
+
+sys.stderr = syslogPrinter()
+
+
def usage():
print "Usage: vdsm [OPTIONS]"
print " -h - Display this help message"
--
To view, visit http://gerrit.ovirt.org/9822
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbdc151f174223e7b54e9dec221c3cd2868b536d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
11 years, 5 months
Change in vdsm[master]: Handling svdsm exception in multipath opeartion
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Handling svdsm exception in multipath opeartion
......................................................................
Handling svdsm exception in multipath opeartion
without handling the exception, the exception is raised to hsm __init__
and cause failure in initialization. afterwards, vdsm is not
operational for hsm operations.
This patch consider svdsm failure as an error in operation without
paralyzed vdsm.
Change-Id: Id56ab966f3a21f4ef9fac0ad05e4f00f25cc16b3
Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=890365
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/storage/multipath.py
1 file changed, 10 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/10508/1
diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py
index ecb644e..52d157b 100644
--- a/vdsm/storage/multipath.py
+++ b/vdsm/storage/multipath.py
@@ -86,8 +86,16 @@
"""
if os.path.exists(MPATH_CONF):
first = second = ''
- svdsm = supervdsm.getProxy()
- mpathconf = svdsm.readMultipathConf()
+ try:
+ svdsm = supervdsm.getProxy()
+ mpathconf = svdsm.readMultipathConf()
+ # we don't handle specific exception types here because any exception
+ # means that the operation failed and we can't destinguish if multipath
+ # is enabled or not
+ except:
+ log.error("failure in reading multipath conf", exc_info=True)
+ return False
+
try:
first = mpathconf[0]
second = mpathconf[1]
--
To view, visit http://gerrit.ovirt.org/10508
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id56ab966f3a21f4ef9fac0ad05e4f00f25cc16b3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
11 years, 5 months
Change in vdsm[master]: BZ#891300 Reload udev rules before calling udevadm trigger.
by lyarwood@redhat.com
Lee Yarwood has uploaded a new change for review.
Change subject: BZ#891300 Reload udev rules before calling udevadm trigger.
......................................................................
BZ#891300 Reload udev rules before calling udevadm trigger.
Change-Id: Ic32ee84b789c7bfaace9a7c96fa835c891b3342f
Signed-off-by: Lee Yarwood <lyarwood(a)redhat.com>
---
M vdsm/storage/hsm.py
M vdsm/supervdsmServer.py
2 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/10656/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index efb2749..bc63645 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2924,6 +2924,7 @@
Warning: Internal use only.
"""
supervdsm.getProxy().appropriateDevice(guid, thiefId)
+ supervdsm.getProxy().udevReloadRules()
supervdsm.getProxy().udevTrigger(guid)
@public
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index 5effd41..994d043 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -215,6 +215,14 @@
return configNetwork.setSafeNetworkConfig()
@logDecorator
+ def udevReloadRules(self):
+ cmd = [EXT_UDEVADM, "control", "--reload-rules"]
+ rc, out, err = misc.execCmd(cmd, sudo=False)
+ if rc:
+ raise OSError(errno.EINVAL, "Could not reload udev rules \
+ out %s\nerr %s" % (out, err))
+
+ @logDecorator
def udevTrigger(self, guid):
cmd = [EXT_UDEVADM, 'trigger', '--verbose', '--action', 'change',
'--property-match=DM_NAME=%s' % guid]
--
To view, visit http://gerrit.ovirt.org/10656
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic32ee84b789c7bfaace9a7c96fa835c891b3342f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Lee Yarwood <lyarwood(a)redhat.com>
11 years, 5 months
Change in vdsm[master]: pep8 fix of contrib vds_bootstrap and vdsm_reg.
by asegurap@redhat.com
Antoni Segura Puimedon has posted comments on this change.
Change subject: pep8 fix of contrib vds_bootstrap and vdsm_reg.
......................................................................
Patch Set 1:
Output of gitpydiff:
antoni@nx01 ~/code/vdsm> gitpydiff
checking contrib/nfs-check.py
2 difference(s)
first file: contrib/nfs-check.py
second file: /tmp/pydiff/contrib/nfs-check.py
((90, "Compare(Name('localMachine'), [('==', Name('True'))])"),
(95, "Name('localMachine')"))
((111, "Compare(Name('targetFound'), [('==', Name('False'))])"),
(116, "Name('targetFound')"))
checking vds_bootstrap/vds_bootstrap.py
1 difference(s)
first file: vds_bootstrap/vds_bootstrap.py
second file: /tmp/pydiff/vds_bootstrap/vds_bootstrap.py
((820, '=='), (862, 'is'))
checking vds_bootstrap/vds_bootstrap_complete.py
checking vdsm_reg/config.py.in
checking vdsm_reg/deployUtil.py.in
15 difference(s)
first file: vdsm_reg/deployUtil.py.in
second file: /tmp/pydiff/vdsm_reg/deployUtil.py.in
((584,
"Compare(CallFunc(Name('type'), [Name('srvName')], None, None), [('==', CallFunc(Name('type'), [Name('None')], None, None))])"),
(624,
"CallFunc(Name('isinstance'), [Name('srvName'), Name('None')], None, None)"))
((624, "Name('Exception')"),
(665,
'CallFunc(Name(\'Exception\'), [Const("The \'reset\' action is not yet implemented for systemd")], None, None)'))
((625, Const("The 'reset' action is not yet implemented for systemd")),
(665, None))
((668, '!='), (712, 'is not'))
((1381, Discard(Const(None))), ('1484 + -', None))
((1442, Discard(Const(None))), ('1549 + -', None))
((1445, Discard(Const(None))), ('1552 + -', None))
((1445, Discard(Const(None))), ('1552 + -', None))
((1449, Discard(Const(None))), ('1556 + -', None))
((1449, Discard(Const(None))), ('1556 + -', None))
((1500, '=='), (1608, 'is'))
((1502, '!='), (1610, 'is not'))
((1504, '!='), (1612, 'is not'))
((1515, '!='), (1624, 'is not'))
((1647,
'\n The fingerprint to compare to the fingerprint of the downloaded\n certificate'),
(1762,
'The fingerprint to compare to the fingerprint of the downloaded certificate'))
checking vdsm_reg/engine.py.in
2 difference(s)
first file: vdsm_reg/engine.py.in
second file: /tmp/pydiff/vdsm_reg/engine.py.in
((70,
Discard(Const("\nUntil the version 3.0, oVirt Engine provided port 8443/8080 to oVirt Node\ndownload cert and others files. Since 3.1 the default port changed to 443/80.\nThis function, will return the compatible port in case the VDSM\ncannot communicate with oVirt Engine.\n\n:param portNumber: port which doesn't communicate with oVirt Engine\n:returns: compatible port number (or None if there is no compatible port)\n and if it's SSL port or not (bool)\n"))),
('64 + -', None))
((92,
Discard(Const("\nThis function will try a http connection to a host with determined\nport, ssl and timeout.\n\n:param host: Host to be tested\n:param port: Which port httplib should use for the test connection\n:param ssl: if it's ssl port or not (bool)\n:param timeout: timeout for the operation, if not speficied the default\n will be socket._GLOBAL_DEFAULT_TIMEOUT\n:returns True or False\n"))),
('86 + -', None))
checking vdsm_reg/register-to-engine.py
antoni@nx01 ~/code/vdsm>
--
To view, visit http://gerrit.ovirt.org/10771
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I44b1bc34c65fc67a04c11ba7d7c49d57f3cc4811
Gerrit-PatchSet: 1
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: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
11 years, 5 months