Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvanes committed Mar 1, 2024
1 parent dc17f17 commit e3ef156
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plsc.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ldap:
sbs:
src:
host: https://sbs.example.net
# host: test
# sync: sync.json
user: sysread
passwd: changethispassword
verify_ssl: True
Expand Down
6 changes: 6 additions & 0 deletions sbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def __init__(self, config):
self.retry = config.get('retry', 3)
self.recording_requested = config.get('recorder', False)

if self.host == 'test':
self.sync = config['sync']

if config.get("ipv4_only", False):
import urllib3.util.connection as urllib3_connection

Expand Down Expand Up @@ -69,6 +72,9 @@ class SBSNoContentException(Exception):

logger.debug(f"API: {request}...")

if self.host == 'test' and request == 'api/plsc/sync':
return json.loads(open(self.sync, 'r').read())

# retry the entire process a few times`
for i in range(0, self.retry):
try:
Expand Down

0 comments on commit e3ef156

Please sign in to comment.