Sample config file added + uncloud dependency removed

This commit is contained in:
ahmadbilalkhalid 2020-02-19 10:22:15 +05:00
parent 200a7672f2
commit 347843cb24
2 changed files with 26 additions and 7 deletions

View file

@ -1,11 +1,9 @@
import etcd3 import etcd3
import json import json
import logging
from functools import wraps from functools import wraps
from uncloud import UncloudException
from uncloud.common import logger
class EtcdEntry: class EtcdEntry:
def __init__(self, meta_or_key, value, value_in_json=True): def __init__(self, meta_or_key, value, value_in_json=True):
@ -26,12 +24,14 @@ def readable_errors(func):
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
try: try:
return func(*args, **kwargs) return func(*args, **kwargs)
except etcd3.exceptions.ConnectionFailedError: except etcd3.exceptions.ConnectionFailedError as err:
raise UncloudException('Cannot connect to etcd: is etcd running as configured in uncloud.conf?') raise etcd3.exceptions.ConnectionFailedError(
'Cannot connect to etcd: is etcd running as configured in uncloud.conf?'
) from err
except etcd3.exceptions.ConnectionTimeoutError as err: except etcd3.exceptions.ConnectionTimeoutError as err:
raise etcd3.exceptions.ConnectionTimeoutError('etcd connection timeout.') from err raise etcd3.exceptions.ConnectionTimeoutError('etcd connection timeout.') from err
except Exception as err: except Exception:
logger.exception('Some etcd error occured. See syslog for details.', err) logging.exception('Some etcd error occured. See syslog for details.')
return wrapper return wrapper

19
sample-pay.conf Normal file
View file

@ -0,0 +1,19 @@
[etcd]
host = 127.0.0.1
port = 2379
[stripe]
private_key=stripe_private_key
[app]
port = 5000
[ldap]
server = ldap_server_url
admin_dn = ldap_admin_dn
admin_password = ldap_admin_password
customer_dn = ldap_customer_dn
user_dn = ldap_user_dn
internal_user_ou = users
customer_ou = customer