Change in vdsm[master]: storageServer: Fix Mismatch initialization
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: storageServer: Fix Mismatch initialization
......................................................................
storageServer: Fix Mismatch initialization
Commit e57e0bdb3e was verified only with the positive flows, since it is
hard to simulate connection mismatch. In case of a real mismatch,
attmpting to log the mismatches would raise "TypeError: not enough
arguments for format string" hiding the real error.
This patch adds some trivial tests and initialize the "args" instance
variable.
Change-Id: Ic9593091c2da6c692f7fcbdd176835a1f2438417
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M tests/Makefile.am
A tests/storageServerTests.py
M vdsm/storage/storageServer.py
3 files changed, 35 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/36604/1
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f644799..564223b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -76,6 +76,7 @@
sslhelper.py \
sslTests.py \
storageMailboxTests.py \
+ storageServerTests.py \
tcTests.py \
testlibTests.py \
toolTests.py \
diff --git a/tests/storageServerTests.py b/tests/storageServerTests.py
new file mode 100644
index 0000000..83099f5
--- /dev/null
+++ b/tests/storageServerTests.py
@@ -0,0 +1,33 @@
+#
+# Copyright 2014 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+from testlib import VdsmTestCase
+from storage.storageServer import IscsiConnection
+
+
+class IscsiConnectionMismatchTests(VdsmTestCase):
+
+ def test_no_args(self):
+ s = str(IscsiConnection.Mismatch("error 1"))
+ self.assertEqual(s, "error 1")
+
+ def test_format(self):
+ s = str(IscsiConnection.Mismatch("error %d with %r", 1, "text"))
+ self.assertEqual(s, "error 1 with 'text'")
diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py
index 1ca4b8f..eb38fb3 100644
--- a/vdsm/storage/storageServer.py
+++ b/vdsm/storage/storageServer.py
@@ -349,7 +349,7 @@
def __init__(self, fmt, *args):
self.fmt = fmt
- self.args
+ self.args = args
def __str__(self):
return self.fmt % self.args
--
To view, visit http://gerrit.ovirt.org/36604
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9593091c2da6c692f7fcbdd176835a1f2438417
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
9 years, 3 months
Change in vdsm[master]: ipwrapper: Make Link.flags official as they are used for RUN...
by osvoboda@redhat.com
Ondřej Svoboda has uploaded a new change for review.
Change subject: ipwrapper: Make Link.flags official as they are used for RUNNING and PROMISC
......................................................................
ipwrapper: Make Link.flags official as they are used for RUNNING and PROMISC
Since 'flags' come from libnl as an integer it makes no sense to populate
them with None though. The two said flags are used in Link's own methods and
cannot be derived from 'state' so 'flags' deserve their own attribute.
Please note that 'flags' can also be a list like ['BROADCAST', 'MULTICAST']
which should be avoided in the future by only using libnl and not parsing
iproute2's output.
pylint2 is now silent for ipwrapper.
Change-Id: Ifc9e516e28d3413274af85dc15f72cabdb64074a
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M lib/vdsm/ipwrapper.py
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/36621/1
diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index 31affaa..0a1d78d 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -121,7 +121,7 @@
def __init__(self, address, index, linkType, mtu, name, qdisc, state,
vlanid=None, vlanprotocol=None, master=None, device=None,
- **kwargs):
+ flags=None, **kwargs):
self.address = address
self.index = index
self.type = linkType
@@ -136,6 +136,8 @@
self.vlanprotocol = vlanprotocol
if device is not None:
self.device = device
+ if flags is not None:
+ self.flags = flags
for key, value in kwargs.items():
setattr(self, key, value)
--
To view, visit http://gerrit.ovirt.org/36621
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc9e516e28d3413274af85dc15f72cabdb64074a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
9 years, 3 months
Change in vdsm[ovirt-3.5]: API: move diskSizeExtend logic from BindingXMLRPC
by tnisan@redhat.com
Hello Nir Soffer, Daniel Erez, Dan Kenigsberg, Allon Mureinik,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/36614
to review the following change.
Change subject: API: move diskSizeExtend logic from BindingXMLRPC
......................................................................
API: move diskSizeExtend logic from BindingXMLRPC
In order to make cold extend disk usable
with JSON-RPC, move logic verifying specified
VM id from 'BindingXMLRPC -> diskSizeExtend' into
'API (VM class) -> diskSizeExtend'
[since there's no other mediator for this logic
to both xml/json rpc protocols].
Change-Id: I9014154f376609d8bd547b7c008954981785b551
Bug-Url: https://bugzilla.redhat.com/1178499
Signed-off-by: Daniel Erez <derez(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/36590
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Allon Mureinik <amureini(a)redhat.com>
Reviewed-by: Tal Nisan <tnisan(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/API.py
M vdsm/rpc/BindingXMLRPC.py
2 files changed, 15 insertions(+), 15 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/36614/1
diff --git a/vdsm/API.py b/vdsm/API.py
index 03f9fba..6c28479 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -583,10 +583,19 @@
return v.diskReplicateFinish(srcDisk, dstDisk)
def diskSizeExtend(self, driveSpecs, newSize):
- v = self._cif.vmContainer.get(self._UUID)
- if not v:
- return errCode['noVM']
- return v.diskSizeExtend(driveSpecs, newSize)
+ if self._UUID == VM.BLANK_UUID:
+ try:
+ volume = Volume(
+ driveSpecs['volumeID'], driveSpecs['poolID'],
+ driveSpecs['domainID'], driveSpecs['imageID'])
+ except KeyError:
+ return errCode['imageErr']
+ return volume.updateSize(newSize)
+ else:
+ v = self._cif.vmContainer.get(self._UUID)
+ if not v:
+ return errCode['noVM']
+ return v.diskSizeExtend(driveSpecs, newSize)
def pause(self):
v = self._cif.vmContainer.get(self._UUID)
diff --git a/vdsm/rpc/BindingXMLRPC.py b/vdsm/rpc/BindingXMLRPC.py
index 31bdde8..8a8e5b7 100644
--- a/vdsm/rpc/BindingXMLRPC.py
+++ b/vdsm/rpc/BindingXMLRPC.py
@@ -531,17 +531,8 @@
return api.getDiskAlignment(driveSpecs)
def diskSizeExtend(self, vmId, driveSpecs, newSize):
- if vmId == API.VM.BLANK_UUID:
- try:
- volume = API.Volume(
- driveSpecs['volumeID'], driveSpecs['poolID'],
- driveSpecs['domainID'], driveSpecs['imageID'])
- except KeyError:
- return errCode['imageErr']
- return volume.updateSize(newSize)
- else:
- vm = API.VM(vmId)
- return vm.diskSizeExtend(driveSpecs, newSize)
+ api = API.VM(vmId)
+ return api.diskSizeExtend(driveSpecs, newSize)
def addNetwork(self, bridge, vlan=None, bond=None, nics=None,
options=None):
--
To view, visit http://gerrit.ovirt.org/36614
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9014154f376609d8bd547b7c008954981785b551
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Tal Nisan <tnisan(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: Nir Soffer <nsoffer(a)redhat.com>
9 years, 3 months
Change in vdsm[master]: storageServer: drop unnecessary list comprehension
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: storageServer: drop unnecessary list comprehension
......................................................................
storageServer: drop unnecessary list comprehension
('%s' % list) is them same as ('%s' % ['%s' % x for x in list]). And
additional benefit in the current code is that formatting takes place
only if the logging level requires it.
And besides that, pyflakes-0.8.1-3.el6.noarch complains about
vdsm/storage/storageServer.py:427: list comprehension redefines 'e' from line 421
Change-Id: I4459f2cf3fb51fc7eaa466be36198b3b46711628
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/storage/storageServer.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/36592/1
diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py
index 1ca4b8f..0639683 100644
--- a/vdsm/storage/storageServer.py
+++ b/vdsm/storage/storageServer.py
@@ -424,7 +424,7 @@
self._lastSessionId = session.id
return session
- self.log.debug("Session mismatches: %s", ["%s" % e for e in errors])
+ self.log.debug("Session mismatches: %s", errors)
raise OSError(errno.ENOENT, "Session not found")
def isConnected(self):
--
To view, visit http://gerrit.ovirt.org/36592
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4459f2cf3fb51fc7eaa466be36198b3b46711628
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
9 years, 3 months
Change in vdsm[ovirt-3.5.0]: API: move diskSizeExtend logic from BindingXMLRPC
by tnisan@redhat.com
Hello Nir Soffer, Daniel Erez, Dan Kenigsberg, Allon Mureinik,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/36613
to review the following change.
Change subject: API: move diskSizeExtend logic from BindingXMLRPC
......................................................................
API: move diskSizeExtend logic from BindingXMLRPC
In order to make cold extend disk usable
with JSON-RPC, move logic verifying specified
VM id from 'BindingXMLRPC -> diskSizeExtend' into
'API (VM class) -> diskSizeExtend'
[since there's no other mediator for this logic
to both xml/json rpc protocols].
Change-Id: I9014154f376609d8bd547b7c008954981785b551
Bug-Url: https://bugzilla.redhat.com/1178499
Signed-off-by: Daniel Erez <derez(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/36590
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Allon Mureinik <amureini(a)redhat.com>
Reviewed-by: Tal Nisan <tnisan(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/API.py
M vdsm/rpc/BindingXMLRPC.py
2 files changed, 15 insertions(+), 15 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/36613/1
diff --git a/vdsm/API.py b/vdsm/API.py
index b2caf44..3d5a883 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -583,10 +583,19 @@
return v.diskReplicateFinish(srcDisk, dstDisk)
def diskSizeExtend(self, driveSpecs, newSize):
- v = self._cif.vmContainer.get(self._UUID)
- if not v:
- return errCode['noVM']
- return v.diskSizeExtend(driveSpecs, newSize)
+ if self._UUID == VM.BLANK_UUID:
+ try:
+ volume = Volume(
+ driveSpecs['volumeID'], driveSpecs['poolID'],
+ driveSpecs['domainID'], driveSpecs['imageID'])
+ except KeyError:
+ return errCode['imageErr']
+ return volume.updateSize(newSize)
+ else:
+ v = self._cif.vmContainer.get(self._UUID)
+ if not v:
+ return errCode['noVM']
+ return v.diskSizeExtend(driveSpecs, newSize)
def pause(self):
v = self._cif.vmContainer.get(self._UUID)
diff --git a/vdsm/rpc/BindingXMLRPC.py b/vdsm/rpc/BindingXMLRPC.py
index d460644..a9d465a 100644
--- a/vdsm/rpc/BindingXMLRPC.py
+++ b/vdsm/rpc/BindingXMLRPC.py
@@ -523,17 +523,8 @@
return api.getDiskAlignment(driveSpecs)
def diskSizeExtend(self, vmId, driveSpecs, newSize):
- if vmId == API.VM.BLANK_UUID:
- try:
- volume = API.Volume(
- driveSpecs['volumeID'], driveSpecs['poolID'],
- driveSpecs['domainID'], driveSpecs['imageID'])
- except KeyError:
- return errCode['imageErr']
- return volume.updateSize(newSize)
- else:
- vm = API.VM(vmId)
- return vm.diskSizeExtend(driveSpecs, newSize)
+ api = API.VM(vmId)
+ return api.diskSizeExtend(driveSpecs, newSize)
def addNetwork(self, bridge, vlan=None, bond=None, nics=None,
options=None):
--
To view, visit http://gerrit.ovirt.org/36613
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9014154f376609d8bd547b7c008954981785b551
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5.0
Gerrit-Owner: Tal Nisan <tnisan(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: Nir Soffer <nsoffer(a)redhat.com>
9 years, 3 months
Change in vdsm[master]: Added errno.ENOTSUP to excepted tc error codes
by ibarkan@redhat.com
Ido Barkan has uploaded a new change for review.
Change subject: Added errno.ENOTSUP to excepted tc error codes
......................................................................
Added errno.ENOTSUP to excepted tc error codes
On RHEL 7, when removing a non existent tc object an ENOTSUP
is returned instead of ENOENT or EINVAL.
Change-Id: I7586efb2929e4356bf09bdd6d15a45e489da5635
Signed-off-by: Ido Barkan <ibarkan(a)redhat.com>
---
M vdsm/network/configurators/qos.py
1 file changed, 5 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/36601/1
diff --git a/vdsm/network/configurators/qos.py b/vdsm/network/configurators/qos.py
index d9ec461..af370af 100644
--- a/vdsm/network/configurators/qos.py
+++ b/vdsm/network/configurators/qos.py
@@ -53,11 +53,13 @@
vlan_tag = models.hierarchy_vlan_tag(top_device)
device = models.hierarchy_backing_device(top_device).name
class_id = '%x' % (_NON_VLANNED_ID if vlan_tag is None else vlan_tag)
+ missing_object_error_codes = (errno.EINVAL, errno.ENOENT, errno.ENOTSUP)
+
try:
tc.filter.delete(
device, pref=_NON_VLANNED_ID if vlan_tag is None else vlan_tag)
except tc.TrafficControlException as tce:
- if tce.errCode not in (errno.EINVAL, errno.ENOENT): # No filter exists
+ if tce.errCode not in missing_object_error_codes: # No filter exists
raise
device_qdiscs = list(tc._qdiscs(device))
@@ -67,7 +69,7 @@
try:
tc.cls.delete(device, classid=root_qdisc_handle + class_id)
except tc.TrafficControlException as tce:
- if tce.errCode not in (errno.EINVAL, errno.ENOENT): # No class exists
+ if tce.errCode not in missing_object_error_codes: # No class exists
raise
if not _uses_classes(device, root_qdisc_handle=root_qdisc_handle):
@@ -75,7 +77,7 @@
tc._qdisc_del(device)
tc._qdisc_del(device, kind='ingress')
except tc.TrafficControlException as tce:
- if tce.errCode not in (errno.EINVAL, errno.ENOENT): # No qdisc
+ if tce.errCode not in missing_object_error_codes: # No qdisc
raise
--
To view, visit http://gerrit.ovirt.org/36601
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7586efb2929e4356bf09bdd6d15a45e489da5635
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
9 years, 3 months
Change in vdsm[master]: New sysctl module
by apahim@redhat.com
Amador Pahim has uploaded a new change for review.
Change subject: New sysctl module
......................................................................
New sysctl module
Some sysctl tunables must be set to configure system in given situations.
This patch is creating the sysctl module to allow such configuration and preparing
this module with the functions needed to handle rp_filter configuration. Since sysctl
tunables can only be set by root user, superVdsm is used as proxy.
Further use of this module can be based in rp_filter configuration.
Change-Id: I950c85a6f8d69494482ff63e569cb17ffc723624
Signed-off-by: Amador Pahim <apahim(a)redhat.com>
---
M lib/vdsm/Makefile.am
A lib/vdsm/sysctl.py
M vdsm.spec.in
M vdsm/supervdsmServer
4 files changed, 48 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/36531/1
diff --git a/lib/vdsm/Makefile.am b/lib/vdsm/Makefile.am
index b862e71..6fc1a16 100644
--- a/lib/vdsm/Makefile.am
+++ b/lib/vdsm/Makefile.am
@@ -33,6 +33,7 @@
profile.py \
qemuimg.py \
sslutils.py \
+ sysctl.py \
utils.py \
vdscli.py \
virtsparsify.py \
diff --git a/lib/vdsm/sysctl.py b/lib/vdsm/sysctl.py
new file mode 100644
index 0000000..6ae7a58
--- /dev/null
+++ b/lib/vdsm/sysctl.py
@@ -0,0 +1,37 @@
+#
+# Copyright 2015 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+
+_RPFILTER_STRICT = '1'
+_RPFILTER_LOOSE = '2'
+
+
+def set_rp_filter(dev, mode):
+ path = '/proc/sys/net/ipv4/conf/%s/rp_filter' % dev
+ with open(path, 'w') as rp_filter:
+ rp_filter.write(mode)
+
+
+def set_rp_filter_loose(dev):
+ set_rp_filter(dev, _RPFILTER_LOOSE)
+
+
+def set_rp_filter_strict(dev):
+ set_rp_filter(dev, _RPFILTER_STRICT)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 55bd0bb..882cc66 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1284,6 +1284,7 @@
%{python_sitelib}/%{vdsm_name}/qemuimg.py*
%{python_sitelib}/%{vdsm_name}/netconfpersistence.py*
%{python_sitelib}/%{vdsm_name}/sslutils.py*
+%{python_sitelib}/%{vdsm_name}/sysctl.py*
%{python_sitelib}/%{vdsm_name}/utils.py*
%{python_sitelib}/%{vdsm_name}/vdscli.py*
%{python_sitelib}/%{vdsm_name}/virtsparsify.py*
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index b1e8603..58e93da 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -54,6 +54,7 @@
_glusterEnabled = False
from vdsm import utils
+from vdsm import sysctl
from vdsm.tool import restore_nets
from parted_utils import getDevicePartedInfo as _getDevicePartedInfo
@@ -359,6 +360,14 @@
def hbaRescan(self):
return hba._rescan()
+ @logDecorator
+ def set_rp_filter_loose(self, dev):
+ sysctl.set_rp_filter_loose(dev)
+
+ @logDecorator
+ def set_rp_filter_strict(self, dev):
+ sysctl.set_rp_filter_strict(dev)
+
def __udevReloadRules(self, guid):
if self.__udevOperationReload():
reload = "--reload"
--
To view, visit http://gerrit.ovirt.org/36531
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I950c85a6f8d69494482ff63e569cb17ffc723624
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amador Pahim <apahim(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: Provide device details using python-blivet module
by tjeyasin@redhat.com
Timothy Asir has uploaded a new change for review.
Change subject: Provide device details using python-blivet module
......................................................................
Provide device details using python-blivet module
This provides list of disks details of the host.
The details are name, container, mount path, model, type of device,
filesystem, size, uuid of the disk.
Change-Id: I85f520c6f476731cb5982d8256cb701387be87cf
Signed-off-by: Timothy Asir <tjeyasin(a)redhat.com>
---
M client/vdsClientGluster.py
M vdsm.spec.in
M vdsm/gluster/__init__.py
M vdsm/gluster/api.py
A vdsm/gluster/storageconf.py
5 files changed, 85 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/28/35028/1
diff --git a/client/vdsClientGluster.py b/client/vdsClientGluster.py
index 421c853..3cd1156 100644
--- a/client/vdsClientGluster.py
+++ b/client/vdsClientGluster.py
@@ -430,6 +430,11 @@
pp.pprint(status)
return status['status']['code'], status['status']['message']
+ def do_glusterGetDeviceInfo(self, args):
+ status = self.s.glusterGetDeviceInfo()
+ pp.pprint(status)
+ return status['status']['code'], status['status']['message']
+
def getGlusterCmdDict(serv):
return \
@@ -731,4 +736,9 @@
('volumeName=<volume name>',
'Returns total, free and used space(bytes) of gluster volume'
)),
+ 'glusterGetDeviceInfo': (
+ serv.do_glusterGetDeviceInfo,
+ ('',
+ 'list all disk info'
+ )),
}
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 36a65e3..bd0e060 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -71,6 +71,7 @@
BuildRequires: python-devel
BuildRequires: python-netaddr
BuildRequires: python-nose
+BuildRequires: python-blivet
BuildRequires: rpm-build
# BuildRequires needed by the tests during the build
@@ -85,7 +86,7 @@
BuildRequires: psmisc
BuildRequires: python-cpopen >= 1.3
BuildRequires: python-inotify
-BuildRequires: python-ioprocess >= 0.14
+#BuildRequires: python-ioprocess >= 0.14
BuildRequires: python-pthreading
BuildRequires: qemu-img
BuildRequires: rpm-python
diff --git a/vdsm/gluster/__init__.py b/vdsm/gluster/__init__.py
index b83efbb..f2d3256 100644
--- a/vdsm/gluster/__init__.py
+++ b/vdsm/gluster/__init__.py
@@ -22,7 +22,7 @@
import tempfile
from functools import wraps
-MODULE_LIST = ('cli', 'hooks', 'services', 'tasks', 'gfapi')
+MODULE_LIST = ('cli', 'hooks', 'services', 'tasks', 'gfapi', 'storageconf')
def makePublic(func):
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index b9a08e5..cdc228d 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -322,6 +322,11 @@
data = self.svdsmProxy.glusterVolumeStatvfs(volumeName)
return self._computeVolumeStats(data)
+ @exportAsVerb
+ def getDeviceInfo(self, options=None):
+ status = self.svdsmProxy.glusterGetDeviceInfo()
+ return {'deviceInfo': status}
+
def getGlusterMethods(gluster):
l = []
diff --git a/vdsm/gluster/storageconf.py b/vdsm/gluster/storageconf.py
new file mode 100644
index 0000000..97a70fd
--- /dev/null
+++ b/vdsm/gluster/storageconf.py
@@ -0,0 +1,67 @@
+#
+# Copyright 2012 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+import blivet
+from . import makePublic
+
+_bb = None
+
+
+def getBlivet():
+ global _bb
+ if _bb:
+ return _bb
+
+ _bb = blivet.Blivet()
+ _bb.reset()
+ return _bb
+
+
+def _getContentType(mountPoint):
+ if mountPoint in ["/", "/boot", "/usr", "/var"]:
+ return 'OS'
+ if mountPoint:
+ return 'DATA'
+ return 'NA'
+
+
+@makePublic
+def getDeviceInfo():
+ b = getBlivet()
+ deviceInfo = []
+ for device in b.devices:
+ info = {}
+ info['name'] = device.name
+ if device.parents:
+ info['container'] = device.parents[0].path
+ info['parent'] = device.parents[0].name
+ if hasattr(device.format, 'mountpoint'):
+ info['contentType'] = _getContentType(device.format.mountpoint)
+ info['mount'] = device.format.mountpoint
+ info['fileSystem'] = device.format.type
+ info['model'] = device.model
+ info['type'] = device.type
+ if device.uuid:
+ info['uuid'] = device.uuid
+ info['formattable'] = device.format.formattable
+ info['resizable'] = device.format.resizable
+ info['size'] = device.size
+ deviceInfo.append(info)
+ return deviceInfo
--
To view, visit http://gerrit.ovirt.org/35028
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I85f520c6f476731cb5982d8256cb701387be87cf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeyasin(a)redhat.com>
9 years, 4 months
Change in vdsm[master]: net stats: add tx/rx statistic to getInterfacesStat
by apahim@redhat.com
Amador Pahim has posted comments on this change.
Change subject: net stats: add tx/rx statistic to getInterfacesStat
......................................................................
Patch Set 12: Code-Review-1
(1 comment)
http://gerrit.ovirt.org/#/c/35061/12/tests/functional/networkTests.py
File tests/functional/networkTests.py:
Line 78: IPv6_ADDRESS_IN_NETWORK = 'fdb3:84e5:4ff4:55e3:0:ffff:ffff:0'
Line 79: IPv6_GATEWAY = 'fdb3:84e5:4ff4:55e3::ff'
Line 80:
Line 81: _ARPPING_COMMAND = CommandPath('arping', '/usr/sbin/arping')
Line 82: _SYSCTL_COMMAND = CommandPath('sysctl', '/usr/sbin/sysctl')
You can drop this line.
Line 83:
Line 84: dummyPool = set()
Line 85: DUMMY_POOL_SIZE = 5
Line 86:
--
To view, visit http://gerrit.ovirt.org/35061
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I314a04570dec56677168e0fdb4a7824d299dbd65
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amir Shladovsky <a.shlado(a)gmail.com>
Gerrit-Reviewer: Amador Pahim <apahim(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <toni(a)midokura.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Lior Vernia <lvernia(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
9 years, 4 months