This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch master
in repository lib389.
commit 1be6ba1d944185244110b66f8add10440001a57e
Author: William Brown <firstyear(a)redhat.com>
Date: Fri Feb 17 16:17:44 2017 +1000
Ticket 2 - pytest mark with version relies on root
Bug Description: pytest checks the ds version by trying to open
nsslapd.
Fix Description: use defaults.inf.
https://pagure.io/lib389/issue/2
Author: wibrown
Review by: vashirov (Thanks!)
---
lib389/__init__.py | 3 ---
lib389/utils.py | 17 +++++++++--------
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/lib389/__init__.py b/lib389/__init__.py
index 008fb11..e189c83 100644
--- a/lib389/__init__.py
+++ b/lib389/__init__.py
@@ -522,9 +522,6 @@ class DirSrv(SimpleLDAPObject, object):
self.creation_suffix = args.get(SER_CREATION_SUFFIX, DEFAULT_SUFFIX)
# These settings are only needed on a local connection.
if self.isLocal:
- # For compatibility keep self.inst but should be removed
- self.inst = self.serverid
-
self.userid = args.get(SER_USER_ID)
if not self.userid:
if os.getuid() == 0:
diff --git a/lib389/utils.py b/lib389/utils.py
index 0d0e261..02fca8f 100644
--- a/lib389/utils.py
+++ b/lib389/utils.py
@@ -39,6 +39,7 @@ from contextlib import closing
from lib389._constants import *
from lib389.properties import *
+from lib389.paths import Paths
MAJOR, MINOR, _, _, _ = sys.version_info
@@ -740,15 +741,15 @@ def formatInfData(args):
def get_ds_version():
- """Return version of ns-slapd binary, for example
- 1.3.4.8 B2016.043.2254"""
- nsslapd = get_sbin_dir() + "/ns-slapd"
- output = subprocess.Popen([nsslapd, "-v"],
- stdout=subprocess.PIPE).communicate()[0]
- fullver = output.splitlines()[1]
- ver = fullver.split('/')[1]
- return ver
+ """
+ Return version of ns-slapd installed on this system. This is determined by the
defaults.inf
+ file, so is correct for the built and installed ns-slapd binary. This function works
without
+ root permissions.
+ returns a string of the form: 1.3.4.8
+ """
+ p = Paths()
+ return p.version
def ds_is_older(ver):
"""Return True if current version of ns-slapd is older than provided
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.