diff --git a/ldapcherry/attributes.py b/ldapcherry/attributes.py index 989bf14..5ddea82 100644 --- a/ldapcherry/attributes.py +++ b/ldapcherry/attributes.py @@ -130,7 +130,9 @@ class Attributes: def get_backend_attributes(self, backend): if backend not in self.backends: raise WrongBackend(backend) - return self.backend_attributes[backend].keys() + ret = list(self.backend_attributes[backend].keys()) + ret.sort() + return ret def get_backend_key(self, backend): if backend not in self.backends: diff --git a/tests/test_Attributes.py b/tests/test_Attributes.py index f7f42b2..aab7342 100644 --- a/tests/test_Attributes.py +++ b/tests/test_Attributes.py @@ -42,6 +42,7 @@ class TestError(object): inv = Attributes('./tests/cfg/attributes.yml') ret = inv.get_backend_attributes('ldap') expected = ['shell', 'cn', 'userPassword', 'uidNumber', 'gidNumber', 'sn', 'home', 'givenName', 'email', 'uid'] + expected.sort() assert ret == expected def testGetKey(self):