This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch master
in repository lib389.
commit decfdbd8900a3f44fc65b9232d0424bb54d96626
Author: William Brown <firstyear(a)redhat.com>
Date: Wed Mar 15 12:28:27 2017 +1000
Ticket 49172 - Allow lib389 to read system schema and instance
Bug Description: lib389 only read instance schema despite the update
to dual locations in 1.3.6.
Fix Description: Glob both paths.
https://pagure.io/389-ds-base/issue/49172
Author: wibrown
Review by: mreynolds (Thanks!)
---
lib389/schema.py | 7 ++++++-
lib389/utils.py | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib389/schema.py b/lib389/schema.py
index fc3ffd1..07b744a 100644
--- a/lib389/schema.py
+++ b/lib389/schema.py
@@ -14,6 +14,7 @@ import glob
import ldap
from ldap.schema.models import AttributeType, ObjectClass, MatchingRule
from lib389._constants import *
+from lib389.utils import ds_is_newer
class Schema(object):
@@ -35,7 +36,11 @@ class Schema(object):
def list_files(self):
"""return a list of the schema files in the instance
schemadir"""
- return glob.glob(self.conn.schemadir + "/*.ldif")
+ file_list = []
+ file_list += glob.glob(self.conn.schemadir + "/*.ldif")
+ if ds_is_newer(1.3.6.0):
+ file_list += glob.glob(self.conn.ds_paths.system_schema_dir +
"/*.ldif")
+ return file_list
def file_to_ldap(self, filename):
"""convert the given schema file name to its python-ldap format
diff --git a/lib389/utils.py b/lib389/utils.py
index 02fca8f..a42cdaa 100644
--- a/lib389/utils.py
+++ b/lib389/utils.py
@@ -756,6 +756,8 @@ def ds_is_older(ver):
version"""
return get_ds_version() < ver
+def ds_is_newer(ver):
+ return get_ds_version() >= ver
def getDateTime():
"""
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.