On 02/12/2017 03:51 PM, Noriko Hosoi
wrote:
Thanks to William for his reviews. I've update the patch based on his suggestion. I also have 2 lib389 patches (attached to this email). Is lib389
still in fedorahosted? I cloned pagure.io/lib389.git, but I found
it empty... 2) if they look fine, is it ok to push them to fedorahosted git repository? Thanks, --noriko |
>From 555887ad67c4bbc623330d5fb0c2664fcaef7029 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi <nhosoi@xxxxxxxxxx> Date: Fri, 27 Jan 2017 15:43:30 -0800 Subject: [PATCH 1/2] dbscan - Support additional options (-t truncate -R) --- lib389/__init__.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib389/__init__.py b/lib389/__init__.py index c7cf0bb..bb3fe26 100644 --- a/lib389/__init__.py +++ b/lib389/__init__.py @@ -2773,12 +2773,14 @@ class DirSrv(SimpleLDAPObject, object): return result - def dbscan(self, bename=None, index=None, key=None): + def dbscan(self, bename=None, index=None, key=None, width=None, isRaw=False): """ @param bename - The backend name to scan @param index - index name (e.g., cn or cn.db) to scan @param key - index key to dump @param id - entry id to dump + @param width - entry truncate size (bytes) + @param isRaw - dump as raw data @return - dumped string """ DirSrvTools.lib389User(user=DEFAULT_USER) @@ -2794,7 +2796,7 @@ class DirSrv(SimpleLDAPObject, object): elif '.db' in index: indexfile = os.path.join(self.dbdir, bename, index) else: - indexfile = os.path.join(self.dbdir, bename, index) + indexfile = os.path.join(self.dbdir, bename, index + '.db') option = '' if 'id2entry' in index: @@ -2804,6 +2806,12 @@ class DirSrv(SimpleLDAPObject, object): if key: option = ' -k %s' % key + if width: + option = option + ' -t %d' % width + + if isRaw: + option = option + ' -R' + cmd = '%s -f %s' % (prog, indexfile) if len(option) > 0: -- 2.9.3
>From a42b9e7b180c289698ed6147fe04ff154e1d5545 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi <nhosoi@xxxxxxxxxx> Date: Sat, 11 Feb 2017 17:05:47 -0800 Subject: [PATCH 2/2] fixing valgrind paths --- lib389/__init__.py | 2 ++ lib389/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib389/__init__.py b/lib389/__init__.py index bb3fe26..a38ee7f 100644 --- a/lib389/__init__.py +++ b/lib389/__init__.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- # --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2015 Red Hat, Inc. # All rights reserved. diff --git a/lib389/utils.py b/lib389/utils.py index 0d0e261..aed46b6 100644 --- a/lib389/utils.py +++ b/lib389/utils.py @@ -208,7 +208,7 @@ def valgrind_enable(sbin_dir, wrapper=None): :raise EnvironmentError: If script is not run as 'root' ''' - if os.geteuid() != 0: + if (sbin_dir == '/sbin' or sbin_dir == '/usr/sbin') and os.geteuid() != 0: log.error('This script must be run as root to use valgrind') raise EnvironmentError @@ -272,7 +272,7 @@ def valgrind_disable(sbin_dir): :raise EnvironmentError: If script is not run as 'root' ''' - if os.geteuid() != 0: + if (sbin_dir == '/sbin' or sbin_dir == '/usr/sbin') and os.geteuid() != 0: log.error('This script must be run as root to use valgrind') raise EnvironmentError -- 2.9.3
_______________________________________________ 389-devel mailing list -- 389-devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to 389-devel-leave@xxxxxxxxxxxxxxxxxxxxxxx