Browse Source

Fix circle (#28)

* Linted useradm to be slightly more pep8

* Linted rbaccount

* Linted rbconfig

* Linted rberror

* Linted rbopt

* Linted rbuser.py

* Linted rbuserdb.py

* Linted sever.py

* Fixed uncapitalised constants

* Fix cirlce tests

* Fix cirlce tests

* Fix cirlce tests
pull/29/head
greenday 4 years ago
committed by Cian Butler
parent
commit
fbb4c6806e
2 changed files with 5 additions and 5 deletions
  1. +1
    -1
      .circleci/config.yml
  2. +4
    -4
      useradm/rbuserdb.py

+ 1
- 1
.circleci/config.yml View File

@@ -14,6 +14,6 @@ jobs:
steps:
- run: apk add --no-cache openldap-dev cyrus-sasl-dev git build-base
- checkout
- run: pip install -r requirements.txt
- run: pip install -r useradm/requirements.txt
- store_test_results:
path: "test-reports/"

+ 4
- 4
useradm/rbuserdb.py View File

@@ -46,8 +46,8 @@ class RBUserDB:

# def connect(self, uri = rbconfig.ldap_uri, dn = rbconfig.ldap_root_dn, password = None,
# dcu_uri = rbconfig.ldap_dcu_uri):
def connect(self, uri=rbconfig.ldap_uri, dn=rbconfig.ldap_root_dn, password=None,
dcu_uri=rbconfig.ldap_dcu_uri, dcu_dn=rbconfig.ldap_dcu_rbdn, dcu_pw=None):
def connect(self, uri=rbconfig.LDAP_URI, dn=rbconfig.LDAP_ROOT_DN, password=None,
dcu_uri=rbconfig.LDAP_DCU_URI, dcu_dn=rbconfig.LDAP_DCU_RBDN, dcu_pw=None):
"""Connect to databases.
Custom URI, DN and password may be given for RedBrick LDAP.
Password if not given will be read from shared secret file set
@@ -55,7 +55,7 @@ class RBUserDB:
Custom URI may be given for DCU LDAP. """
if not password:
try:
pw_file = open(rbconfig.ldap_rootpw_file, 'r')
pw_file = open(rbconfig.LDAP_ROOTPW_FILE, 'r')
password = pw_file.readline().rstrip()
except IOError:
raise RBFatalError("Unable to open LDAP root password file")
@@ -63,7 +63,7 @@ class RBUserDB:

if not dcu_pw:
try:
pw_file = open(rbconfig.ldap_dcu_rbpw, 'r')
pw_file = open(rbconfig.LDAP_DCU_RBPW, 'r')
dcu_pw = pw_file.readline().rstrip()
except IOError:
raise RBFatalError("Unable to open DCU AD root password file")


Loading…
Cancel
Save