Change in vdsm[master]: network: use native strings with libnl
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: network: use native strings with libnl
......................................................................
Patch Set 4: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/77716/4/lib/vdsm/network/netlink/libnl.py
File lib/vdsm/network/netlink/libnl.py:
Line 111: return CFUNCTYPE(return_type, *arguments)((function_name, LIBNL_ROUTE))
Line 112:
Line 113:
Line 114: def _to_str(value):
Line 115: """Convert textual value to native string."""
> Edy's code is better, since it forces the function caller to support unicod
I'm told that value can never be unicode; even if not - please add an else clause raising ValueError. We must never let _to_str() retrun None silently.
Line 116: if isinstance(value, str):
Line 117: return value
Line 118: elif six.PY2:
Line 119: return value.encode('utf-8')
--
To view, visit https://gerrit.ovirt.org/77716
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I21dec9beeb6a70fc16005a85669d1826b785bf9b
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Petr Horacek <phoracek(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes
6 years, 11 months
Change in vdsm[master]: network: use native strings with libnl
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: network: use native strings with libnl
......................................................................
Patch Set 4:
(1 comment)
https://gerrit.ovirt.org/#/c/77716/4/lib/vdsm/network/netlink/libnl.py
File lib/vdsm/network/netlink/libnl.py:
Line 111: return CFUNCTYPE(return_type, *arguments)((function_name, LIBNL_ROUTE))
Line 112:
Line 113:
Line 114: def _to_str(value):
Line 115: """Convert textual value to native string."""
> I find this bad, it is in fact a TODO that seems never to be resolved.
Edy's code is better, since it forces the function caller to support unicode strings, in case they are returned.
This is a little step forward towards a dream of unicode-only vdsm. But the big question is whether this is currently working; we may need to modify multiple callers in order to support that.
Line 116: if isinstance(value, str):
Line 117: return value
Line 118: elif six.PY2:
Line 119: return value.encode('utf-8')
--
To view, visit https://gerrit.ovirt.org/77716
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I21dec9beeb6a70fc16005a85669d1826b785bf9b
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Petr Horacek <phoracek(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes
6 years, 11 months
Change in vdsm[master]: janitorial: net tests: remove unused constants
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has uploaded a new change for review.
Change subject: janitorial: net tests: remove unused constants
......................................................................
janitorial: net tests: remove unused constants
Change-Id: I3e6ce94d100cb6e20230c27ae0556688df26211c
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M tests/network/link_setup_test.py
M tests/network/netfunctestlib.py
2 files changed, 0 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/77687/1
diff --git a/tests/network/link_setup_test.py b/tests/network/link_setup_test.py
index bbe5ba9..8df28e6 100644
--- a/tests/network/link_setup_test.py
+++ b/tests/network/link_setup_test.py
@@ -25,7 +25,6 @@
from vdsm.network.link import setup as linksetup
BOND1_NAME = 'bond1'
-BOND2_NAME = 'bond2'
@attr(type='unit')
diff --git a/tests/network/netfunctestlib.py b/tests/network/netfunctestlib.py
index e854033..667b7fe 100644
--- a/tests/network/netfunctestlib.py
+++ b/tests/network/netfunctestlib.py
@@ -42,8 +42,6 @@
except ImportError:
ipaddress = None
-CAPS_INFO = 2
-
NOCHK = {'connectivityCheck': False}
IFCFG_DIR = '/etc/sysconfig/network-scripts/'
--
To view, visit https://gerrit.ovirt.org/77687
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e6ce94d100cb6e20230c27ae0556688df26211c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
6 years, 11 months
Change in vdsm[master]: janitorial: drop unused sotrage constants
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has uploaded a new change for review.
Change subject: janitorial: drop unused sotrage constants
......................................................................
janitorial: drop unused sotrage constants
Change-Id: I5312ba85b9b1dfaea293668437bd14ec6f39c9df
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/storage/iscsi.py
M lib/vdsm/storage/lvm.py
M lib/vdsm/storage/misc.py
M lib/vdsm/storage/mount.py
M lib/vdsm/storage/task.py
M lib/vdsm/virt/vmstats.py
M vdsm/storage/hsm.py
M vdsm/storage/sdc.py
8 files changed, 0 insertions(+), 17 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/77689/1
diff --git a/lib/vdsm/storage/iscsi.py b/lib/vdsm/storage/iscsi.py
index 59edcd2..223a7be 100644
--- a/lib/vdsm/storage/iscsi.py
+++ b/lib/vdsm/storage/iscsi.py
@@ -73,7 +73,6 @@
DEFAULT_TPGT = 1
-ISCSI_DEFAULT_PORT = 3260
IscsiSession = namedtuple("IscsiSession", "id, iface, target, credentials")
diff --git a/lib/vdsm/storage/lvm.py b/lib/vdsm/storage/lvm.py
index b01bb94..bedf364 100644
--- a/lib/vdsm/storage/lvm.py
+++ b/lib/vdsm/storage/lvm.py
@@ -50,8 +50,6 @@
log = logging.getLogger("storage.LVM")
-LVM_DEFAULT_TTL = 100
-
PV_FIELDS = ("uuid,name,size,vg_name,vg_uuid,pe_start,pe_count,"
"pe_alloc_count,mda_count,dev_size,mda_used_count")
VG_FIELDS = ("uuid,name,attr,size,free,extent_size,extent_count,free_count,"
diff --git a/lib/vdsm/storage/misc.py b/lib/vdsm/storage/misc.py
index d2499cd..c27eab6 100644
--- a/lib/vdsm/storage/misc.py
+++ b/lib/vdsm/storage/misc.py
@@ -57,7 +57,6 @@
IOUSER = "vdsm"
DIRECTFLAG = "direct"
-DATASYNCFLAG = "fdatasync"
STR_UUID_SIZE = 36
UUID_HYPHENS = [8, 13, 18, 23]
MEGA = 1 << 20
diff --git a/lib/vdsm/storage/mount.py b/lib/vdsm/storage/mount.py
index 9d4072b..3939724 100644
--- a/lib/vdsm/storage/mount.py
+++ b/lib/vdsm/storage/mount.py
@@ -40,8 +40,6 @@
# Common vfs types
-VFS_NFS = "nfs"
-VFS_NFS4 = "nfs4"
VFS_EXT3 = "ext3"
MountRecord = namedtuple("MountRecord", "fs_spec fs_file fs_vfstype "
diff --git a/lib/vdsm/storage/task.py b/lib/vdsm/storage/task.py
index 726f901..16f303f 100644
--- a/lib/vdsm/storage/task.py
+++ b/lib/vdsm/storage/task.py
@@ -78,7 +78,6 @@
TEMP_EXT = ".temp"
NUM_SEP = "."
FIELD_SEP = ","
-RESOURCE_SEP = "!"
TASK_METADATA_VERSION = 1
ROLLBACK_SENTINEL = "rollback sentinel"
diff --git a/lib/vdsm/virt/vmstats.py b/lib/vdsm/virt/vmstats.py
index 8038fa2..8dd6b1c 100644
--- a/lib/vdsm/virt/vmstats.py
+++ b/lib/vdsm/virt/vmstats.py
@@ -31,9 +31,6 @@
from vdsm.virt.utils import isVdsmImage
-_MBPS_TO_BPS = 10 ** 6 / 8
-
-
def produce(vm, first_sample, last_sample, interval):
"""
Translates vm samples into stats.
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 1109d3d..7526cf8 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -96,9 +96,6 @@
TYPE = "type"
INITIALIZED = "initialized"
CAPACITY = "capacity"
-PATHLIST = "pathlist"
-
-STORAGE_CONNECTION_DIR = os.path.join(constants.P_VDSM_LIB, "connections/")
QEMU_READABLE_TIMEOUT = 30
diff --git a/vdsm/storage/sdc.py b/vdsm/storage/sdc.py
index 552b1b6..3c6b8ce 100644
--- a/vdsm/storage/sdc.py
+++ b/vdsm/storage/sdc.py
@@ -32,10 +32,6 @@
from vdsm.storage import multipath
-# Default cache age until forcibly refreshed
-DEFAULT_REFRESH_INTERVAL = 300
-
-
class DomainProxy(object):
"""
Keeps domain references valid even when underlying domain object changes
--
To view, visit https://gerrit.ovirt.org/77689
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5312ba85b9b1dfaea293668437bd14ec6f39c9df
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
6 years, 11 months
Change in vdsm[master]: janitorial: drop unused storage.misc.getProcCtime
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has uploaded a new change for review.
Change subject: janitorial: drop unused storage.misc.getProcCtime
......................................................................
janitorial: drop unused storage.misc.getProcCtime
Should have been removed with commit bb50245.
Change-Id: Iaabc3ec4507ae3ca46c5a7f2aee130731ec2b1ca
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/storage/misc.py
1 file changed, 0 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/77738/1
diff --git a/lib/vdsm/storage/misc.py b/lib/vdsm/storage/misc.py
index d2499cd..da76a10 100644
--- a/lib/vdsm/storage/misc.py
+++ b/lib/vdsm/storage/misc.py
@@ -92,17 +92,6 @@
return True
-def getProcCtime(pid):
- try:
- stats = os.stat(os.path.join('/proc', str(pid)))
- ctime = stats.st_ctime
- except OSError:
- raise OSError(os.errno.ESRCH,
- "Could not find process with pid %s" % pid)
-
- return str(ctime)
-
-
def readblock(name, offset, size):
'''
Read (direct IO) the content of device 'name' at offset, size bytes
--
To view, visit https://gerrit.ovirt.org/77738
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaabc3ec4507ae3ca46c5a7f2aee130731ec2b1ca
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
6 years, 11 months
Change in vdsm[master]: tests: enable thread-leak-check
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has uploaded a new change for review.
Change subject: tests: enable thread-leak-check
......................................................................
tests: enable thread-leak-check
Change-Id: Ifa51145c8301a3597754e0a30b79cc5de36863f1
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M tests/Makefile.am
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/77746/1
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5187741..c842a81 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -405,7 +405,8 @@
check:
@echo '*** Running tests. To skip this step place NOSE_EXCLUDE=.* ***'
@echo '*** into your environment. Do not submit untested code! ***'
- $(top_srcdir)/tests/run_tests_local.sh $(run_modules)
+ $(top_srcdir)/tests/run_tests_local.sh --with-thread-leak-check \
+ $(run_modules)
if [ "$(PYTHON3_SUPPORT)" == "1" ]; then \
all_modules=`mktemp`; \
blacklist=`mktemp`; \
@@ -414,7 +415,7 @@
"$$blacklist"; \
modules=$$(comm -2 -3 "$$all_modules" "$$blacklist"); \
rm -f "$$all_modules" "$$blacklist"; \
- PYTHON_EXE="$(PYTHON3)" \
+ PYTHON_EXE="$(PYTHON3)" --with-thread-leak-check \
$(top_srcdir)/tests/run_tests_local.sh "$$modules"; \
fi
--
To view, visit https://gerrit.ovirt.org/77746
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa51145c8301a3597754e0a30b79cc5de36863f1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
6 years, 11 months
Change in vdsm[master]: net tests: add a slightly more meaningful message on exception
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has uploaded a new change for review.
Change subject: net tests: add a slightly more meaningful message on exception
......................................................................
net tests: add a slightly more meaningful message on exception
Seeing a list of offending rules or routes is more legible than a
generic
AssertionError: 2 != 3
Change-Id: I9ede150d5c35be4eddd14bf68e423c0477f747ca
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M tests/network/sourceroute_test.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/77731/1
diff --git a/tests/network/sourceroute_test.py b/tests/network/sourceroute_test.py
index 4f8a387..74ebe5f 100644
--- a/tests/network/sourceroute_test.py
+++ b/tests/network/sourceroute_test.py
@@ -76,8 +76,8 @@
dsroute = DynamicSourceRoute(nic, None, None, None)
routes, rules = dsroute.current_srconfig()
- self.assertEqual(2, len(routes))
- self.assertEqual(2, len(rules))
+ self.assertEqual(2, len(routes), routes)
+ self.assertEqual(2, len(rules), rules)
self.assertEqual('0.0.0.0/0', routes[0].to)
self.assertEqual(nic, routes[0].device)
--
To view, visit https://gerrit.ovirt.org/77731
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ede150d5c35be4eddd14bf68e423c0477f747ca
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
6 years, 11 months
Change in vdsm[master]: tox: Update flake8 to version 3.1.0
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: tox: Update flake8 to version 3.1.0
......................................................................
Patch Set 1: Code-Review+1
right now I don't really mind which version we use.
--
To view, visit https://gerrit.ovirt.org/77727
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie79c47a920cbedfad60ff277a28a11e354d00c54
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(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: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
6 years, 11 months
Change in vdsm[master]: network: use native strings with libnl
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: network: use native strings with libnl
......................................................................
Patch Set 4:
(1 comment)
https://gerrit.ovirt.org/#/c/77716/4//COMMIT_MSG
Commit Message:
Line 4: Commit: Petr Horáček <phoracek(a)redhat.com>
Line 5: CommitDate: 2017-06-02 23:17:44 +0200
Line 6:
Line 7: network: use native strings with libnl
Line 8:
I miss the motivation for this.
I don't like this leniency; I'd expect the caller to worry about sending unicode in python2 and string in python2.
Simplifying our life (as the sole user of libnl.py) is a good reason, but I'd like to understand where exactly this helps.
Line 9: Change-Id: I21dec9beeb6a70fc16005a85669d1826b785bf9b
--
To view, visit https://gerrit.ovirt.org/77716
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I21dec9beeb6a70fc16005a85669d1826b785bf9b
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Petr Horacek <phoracek(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes
6 years, 11 months
Change in vdsm[master]: janitorial: storage tests: drop unused constants
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has uploaded a new change for review.
Change subject: janitorial: storage tests: drop unused constants
......................................................................
janitorial: storage tests: drop unused constants
Change-Id: I323cbe255dc189d274e00d931a447eb90a011f18
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M tests/storage_misc_test.py
M tests/storagetestlib.py
2 files changed, 0 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/88/77688/1
diff --git a/tests/storage_misc_test.py b/tests/storage_misc_test.py
index d79e628..a5b06f0 100644
--- a/tests/storage_misc_test.py
+++ b/tests/storage_misc_test.py
@@ -44,8 +44,6 @@
from monkeypatch import MonkeyPatch
from testValidation import checkSudo
-EXT_CHMOD = "/bin/chmod"
-EXT_CHOWN = "/bin/chown"
EXT_DD = "/bin/dd"
EXT_CAT = "cat"
diff --git a/tests/storagetestlib.py b/tests/storagetestlib.py
index acec801..4a5f291 100644
--- a/tests/storagetestlib.py
+++ b/tests/storagetestlib.py
@@ -40,7 +40,6 @@
NR_PVS = 2 # The number of fake PVs we use to make a fake VG by default
-MDSIZE = 524288 # The size (in bytes) of fake metadata files
MB = 1024 ** 2 # Used to convert bytes to MB
--
To view, visit https://gerrit.ovirt.org/77688
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I323cbe255dc189d274e00d931a447eb90a011f18
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
6 years, 11 months