diff --git a/internal/policies/certificate/cert-autoenroll b/internal/policies/certificate/cert-autoenroll index f6b939efd..44c0b68d8 100755 --- a/internal/policies/certificate/cert-autoenroll +++ b/internal/policies/certificate/cert-autoenroll @@ -13,6 +13,7 @@ from samba.dcerpc import preg from vendor_samba.gp.gpclass import GPOStorage from vendor_samba.gp import gp_cert_auto_enroll_ext as cae +from vendor_samba.gp.util.logging import logger_init class adsys_cert_auto_enroll(cae.gp_cert_auto_enroll_ext): def enroll(self, guid, entries, trust_dir, private_dir, global_trust_dir): @@ -74,6 +75,9 @@ def main(): username = c.get_username() store = GPOStorage(os.path.join(samba_cache_dir, f'cert_gpo_state_{args.object_name}.tdb')) + # Set up logging + logger_init('cert-autoenroll', lp.log_level()) + ext = adsys_cert_auto_enroll(lp, c, username, store) guid = f'adsys-cert-autoenroll-{args.object_name}' if args.action == 'enroll': diff --git a/internal/testutils/admock/samba/param/__init__.py b/internal/testutils/admock/samba/param/__init__.py index f85b80128..00ff4c718 100644 --- a/internal/testutils/admock/samba/param/__init__.py +++ b/internal/testutils/admock/samba/param/__init__.py @@ -1,6 +1,10 @@ -def LoadParm(smb_conf=None): - if smb_conf is None: - return - print('Loading smb.conf') - with open(smb_conf, 'r') as f: - print(f.read()) +class LoadParm(object): + def __init__(self, smb_conf=None): + if smb_conf is None: + return + print('Loading smb.conf') + with open(smb_conf, 'r') as f: + print(f.read()) + + def log_level(self): + return 0 diff --git a/internal/testutils/admock/vendor_samba/gp/util/__init__.py b/internal/testutils/admock/vendor_samba/gp/util/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/internal/testutils/admock/vendor_samba/gp/util/logging.py b/internal/testutils/admock/vendor_samba/gp/util/logging.py new file mode 100644 index 000000000..dd4bc4bfe --- /dev/null +++ b/internal/testutils/admock/vendor_samba/gp/util/logging.py @@ -0,0 +1,2 @@ +def logger_init(_name, _level): + pass