mooli tayer has posted comments on this change.
Change subject: tool: change configurators from classes to modules.
......................................................................
Patch Set 3:
(2 comments)
http://gerrit.ovirt.org/#/c/34047/3/lib/vdsm/tool/configurator.py
File lib/vdsm/tool/configurator.py:
Line 60: initialization.
Line 61:
Line 62: Note: after configure isconfigured should return NOT_SURE or CONFIGURED.
Line 63:
Line 64: removeConf: [optional function]
> Missing \n
done
Line 65: Cleanup vdsm's configuration.
Line 66: """
Line 67:
Line 68:
Line 236:
Line 237: while queue:
Line 238: next_ = queue.popleft()
Line 239: try:
Line 240: requiredNames = getattr(_CONFIGURATORS[next_],
> do alonbl style
yay, done
Line 241: 'requires',
Line 242: frozenset())
Line 243: except KeyError:
Line 244: available = ', '.join(sorted(_CONFIGURATORS))
--
To view, visit http://gerrit.ovirt.org/34047
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iff5d588cfbbcfe0d5f4a90d624d24f21ef4cc580
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
Yeela Kaplan has uploaded a new change for review.
Change subject: utils: Use ovirt node for persist files
......................................................................
utils: Use ovirt node for persist files
Change-Id: Ice245d54497862f9fb86cb32acd13b8a790026b2
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/utils.py
1 file changed, 9 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/33468/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index e08ec3c..d619e98 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -53,6 +53,15 @@
from cpopen import CPopen
from . import constants
+try:
+ from ovirt.node.utils.fs import Config
+ cfg = Config()
+ persistFile = cfg.persist
+ del cfg
+except ImportError:
+ persistFile = lambda name: None
+
+
# Buffsize is 1K because I tested it on some use cases and 1K was fastest. If
# you find this number to be a bottleneck in any way you are welcome to change
# it
@@ -141,11 +150,6 @@
logging.warning("Directory: %s already removed", directoryToRemove)
else:
raise
-
-
-def persistFile(name):
- if isOvirtNode():
- execCmd([constants.EXT_PERSIST, name], sudo=True)
def _parseMemInfo(lines):
--
To view, visit http://gerrit.ovirt.org/33468
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice245d54497862f9fb86cb32acd13b8a790026b2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
Saggi Mizrahi has posted comments on this change.
Change subject: tool: change configurators from classes to modules.
......................................................................
Patch Set 3: Code-Review+2
(2 comments)
http://gerrit.ovirt.org/#/c/34047/3/lib/vdsm/tool/configurator.py
File lib/vdsm/tool/configurator.py:
Line 60: initialization.
Line 61:
Line 62: Note: after configure isconfigured should return NOT_SURE or CONFIGURED.
Line 63:
Line 64: removeConf: [optional function]
Missing \n
Line 65: Cleanup vdsm's configuration.
Line 66: """
Line 67:
Line 68:
Line 236:
Line 237: while queue:
Line 238: next_ = queue.popleft()
Line 239: try:
Line 240: requiredNames = getattr(_CONFIGURATORS[next_],
do alonbl style
Line 241: 'requires',
Line 242: frozenset())
Line 243: except KeyError:
Line 244: available = ', '.join(sorted(_CONFIGURATORS))
--
To view, visit http://gerrit.ovirt.org/34047
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iff5d588cfbbcfe0d5f4a90d624d24f21ef4cc580
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
Dima Kuznetsov has uploaded a new change for review.
Change subject: supervdsm: Switch multiprocessing to CPopen
......................................................................
supervdsm: Switch multiprocessing to CPopen
Default implementation of multiprocessing.Process used Popen to create
processes, this resulted in zombies being present after the process was
done. This change monkeypatches Process to use cpopen.
Change-Id: I5333caf7a1162c5d783f556bb9204fb74d1ab469
Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=841486
Signed-off-by: Dima Kuznetsov <dkuznets(a)redhat.com>
---
M vdsm/supervdsmServer
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/28915/1
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index f9395eb..0a88a21 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -44,7 +44,9 @@
log.warn("Could not init proper logging", exc_info=True)
from storage import fuser
+import cpopen
from multiprocessing import Pipe, Process
+Process._Popen = cpopen.CPopen
try:
from gluster import listPublicFunctions
_glusterEnabled = True
--
To view, visit http://gerrit.ovirt.org/28915
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5333caf7a1162c5d783f556bb9204fb74d1ab469
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets(a)redhat.com>
Frank Kobzik has uploaded a new change for review.
Change subject: vm: return displayIp as a string in default case
......................................................................
vm: return displayIp as a string in default case
Previously, default value of displayInfo.displayIp was number 0. This patch
changes it to string '0' so that it conforms to the schema.
Signed-off-by: Frantisek Kobzik <fkobzik(a)redhat.com>
Change-Id: If211e80d731de27dd5d5154c32dd63bef5c2be2a
---
M vdsm/virt/vm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/34675/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 8b17a03..6b382b4 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2347,7 +2347,7 @@
'port', GraphicsDevice.LIBVIRT_PORT_AUTOSELECT),
'tlsPort': dev.get(
'tlsPort', GraphicsDevice.LIBVIRT_PORT_AUTOSELECT),
- 'ipAddress': dev.get('specParams', {}).get('displayIp', 0)}
+ 'ipAddress': dev.get('specParams', {}).get('displayIp', '0')}
return {
'displayInfo': [getInfo(dev)
--
To view, visit http://gerrit.ovirt.org/34675
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If211e80d731de27dd5d5154c32dd63bef5c2be2a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <fkobzik(a)redhat.com>
Shahar Havivi has uploaded a new change for review.
Change subject: libvirtconnection: add credentials other then defalut
......................................................................
libvirtconnection: add credentials other then defalut
Adding username, passwd, and uri for libvirtconnection module -
Enabling to connect to libvirt with other credentials then
the default configuration.
This will be needed by the v2v future patches which will needed to
connect to remove libvirt given a uri.
Change-Id: I3481d56ee19afec14b36b98b412278148b26379e
Signed-off-by: Shahar Havivi <shaharh(a)redhat.com>
---
M lib/vdsm/libvirtconnection.py
1 file changed, 13 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/34293/1
diff --git a/lib/vdsm/libvirtconnection.py b/lib/vdsm/libvirtconnection.py
index b1332db..c261977 100644
--- a/lib/vdsm/libvirtconnection.py
+++ b/lib/vdsm/libvirtconnection.py
@@ -77,12 +77,16 @@
__connectionLock = threading.Lock()
-def _open_qemu_connection():
+def _open_qemu_connection(username=None, passwd=None, uri=None):
+ username = constants.SASL_USERNAME if username is None else username
+ passwd = file(constants.P_VDSM_LIBVIRT_PASSWD).readline().rstrip("\n") \
+ if passwd is None else passwd
+ uri = 'qemu:///system' if uri is None else uri
+
def req(credentials, user_data):
- passwd = file(constants.P_VDSM_LIBVIRT_PASSWD).readline().rstrip("\n")
for cred in credentials:
if cred[0] == libvirt.VIR_CRED_AUTHNAME:
- cred[4] = constants.SASL_USERNAME
+ cred[4] = username
elif cred[0] == libvirt.VIR_CRED_PASSPHRASE:
cred[4] = passwd
return 0
@@ -91,15 +95,18 @@
req, None]
libvirtOpen = functools.partial(
- libvirt.openAuth, 'qemu:///system', auth, 0)
+ libvirt.openAuth, uri, auth, 0)
return utils.retry(libvirtOpen, timeout=10, sleep=0.2)
-def get(target=None, killOnFailure=True):
+def get(target=None, killOnFailure=True, username=None, passwd=None, uri=None):
"""Return current connection to libvirt or open a new one.
Use target to get/create the connection object linked to that object.
target must have a callable attribute named 'dispatchLibvirtEvents' which
will be registered as a callback on libvirt events.
+
+ When wanting to connect to a different libvirt connection use the username,
+ passwd and uri parameters
Wrap methods of connection object so that they catch disconnection, and
take the current process down.
@@ -148,7 +155,7 @@
conn = __connections.get(id(target))
if not conn:
log.debug('trying to connect libvirt')
- conn = _open_qemu_connection()
+ conn = _open_qemu_connection(username, passwd, uri)
__connections[id(target)] = conn
setattr(conn, 'pingLibvirt', getattr(conn, 'getLibVersion'))
--
To view, visit http://gerrit.ovirt.org/34293
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3481d56ee19afec14b36b98b412278148b26379e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi(a)redhat.com>
Nir Soffer has uploaded a new change for review.
Change subject: guestagent: Use new style class
......................................................................
guestagent: Use new style class
Using old style class is a trap for innocent developers. They do not
support properties in a nasty way, and should be forbidden in vdsm code.
Change-Id: I138ded6cb33d7927b2701606698aaf95ebf39742
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/virt/guestagent.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/34624/1
diff --git a/vdsm/virt/guestagent.py b/vdsm/virt/guestagent.py
index 0be7e6b..a403b0d 100644
--- a/vdsm/virt/guestagent.py
+++ b/vdsm/virt/guestagent.py
@@ -109,7 +109,7 @@
Exception.__init__(self, message)
-class GuestAgent ():
+class GuestAgent(object):
MAX_MESSAGE_SIZE = 2 ** 20 # 1 MiB for now
def __init__(self, socketName, channelListener, log, user='Unknown',
--
To view, visit http://gerrit.ovirt.org/34624
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I138ded6cb33d7927b2701606698aaf95ebf39742
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Nir Soffer has uploaded a new change for review.
Change subject: domain_descriptor: More careful falsy check
......................................................................
domain_descriptor: More careful falsy check
Using "if self._devices" works with xml.minidom, but if we switch our xml
library to xml.etree, empty element is considered falsy, which will
create same hash for different xml.
While this may be a non-issue, using "if self._devices is not None" is
more correct and predictable.
Change-Id: Id805237342b3e00334e0e540ce8f4e919cf0107e
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/virt/domain_descriptor.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/34623/1
diff --git a/vdsm/virt/domain_descriptor.py b/vdsm/virt/domain_descriptor.py
index 3e567ab..dbd6dca 100644
--- a/vdsm/virt/domain_descriptor.py
+++ b/vdsm/virt/domain_descriptor.py
@@ -27,7 +27,7 @@
self._dom = xml.dom.minidom.parseString(xmlStr)
self._devices = self._firstElementByTagName('devices')
self._devicesHash = hash(self._devices.toxml()
- if self._devices else '')
+ if self._devices is not None else '')
@classmethod
def fromId(cls, uuid):
--
To view, visit http://gerrit.ovirt.org/34623
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id805237342b3e00334e0e540ce8f4e919cf0107e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>