Skip to main content
Sign in
Snippets Groups Projects
Commit 86a96c1e authored by Pavel Kácha's avatar Pavel Kácha
Browse files

config cleanup, sql cleanup, import cleanup, version bump

parent e4a76559
Branches
Tags
No related merge requests found
......@@ -267,10 +267,10 @@ $ curl \
--request POST \
"https://warden.example.org/getInfo?secret=SeCrEt"
{"version": "3.0-not-even-alpha",
{"version": "3.0-beta1",
"send_events_limit": 500,
"get_events_limit": 1000,
"description": "Warden 3 not even alpha development server"}
"description": "Warden 3 server"}
D. Python API
......@@ -289,7 +289,7 @@ wclient = warden.Client(
timeout=60,
retry=3,
pause=5,
recv_events_limit=6000,
get_events_limit=6000,
send_events_limit=500,
errlog={},
syslog=None,
......@@ -304,7 +304,7 @@ wclient = warden.Client(
* timeout - network timeout value in seconds
* retry - number retries on transitional errors during sending events
* pause - wait time in seconds between transitional error retries
* recv_events_limit - maximum number of events to receive (note that server
* get_events_limit - maximum number of events to receive (note that server
may have its own notion)
* send_events_limit - when sending, event lists will be split and sent by
chunks of at most this size (note that used value will get adjusted according
......
......
{
"url": "https://midas.civ.zcu.cz:8888/warden3",
"url": "https://warden-hub.example.org/warden3",
"certfile": "kostik.zcu.cz-cert.pem",
"keyfile": "kostik.zcu.cz-key.pem",
"cafile": "Warden_CA-cacert.pem",
"certfile": "cert.pem",
"keyfile": "key.pem",
"cafile": "cacert.pem",
"timeout": 60,
"recv_events_limit": 6000,
"get_events_limit": 1000,
"errlog": {"level": "debug"},
"filelog": {"file": "warden_client.log", "level": "warning"},
#"syslog": {"socket": "/dev/log", "facility": "local7", "level": "warning"},
//"syslog": {"socket": "/dev/log", "facility": "local7", "level": "warning"},
"idstore": "warden_client.id",
"name": "warden_client_kostik",
"name": "org.example.warden_client",
"secret": "Phaipe5ush7p"
"secret": "ToP_SeCrEt"
}
......@@ -8,13 +8,12 @@ import json, httplib, ssl, socket, logging, logging.handlers, time
from urlparse import urlparse
from urllib import urlencode
from sys import stderr, exc_info
from pprint import pformat
from traceback import format_tb
from os import path
from operator import itemgetter
VERSION = "3.0-beta0"
VERSION = "3.0-beta1"
class HTTPSConnection(httplib.HTTPSConnection):
'''
......@@ -210,7 +209,7 @@ class Client(object):
timeout=60,
retry=3,
pause=5,
recv_events_limit=6000,
get_events_limit=6000,
send_events_limit=500,
errlog={},
syslog=None,
......@@ -234,7 +233,7 @@ class Client(object):
self.keyfile = path.join(base, keyfile or "key.pem")
self.cafile = path.join(base, cafile or "ca.pem")
self.timeout = int(timeout)
self.recv_events_limit = int(recv_events_limit)
self.get_events_limit = int(get_events_limit)
self.idstore = path.join(base, idstore) if idstore is not None else None
self.send_events_limit = int(send_events_limit)
......@@ -467,7 +466,7 @@ class Client(object):
else:
try:
self.send_events_limit = min(res["send_events_limit"], self.send_events_limit)
self.recv_events_limit = min(res["recv_events_limit"], self.recv_events_limit)
self.get_events_limit = min(res["get_events_limit"], self.get_events_limit)
except (AttributeError, TypeError, KeyError):
pass
return res
......@@ -551,7 +550,7 @@ class Client(object):
id = self._loadID(idstore)
res = self.sendRequest(
"getEvents", id=id, count=count or self.recv_events_limit, cat=cat,
"getEvents", id=id, count=count or self.get_events_limit, cat=cat,
nocat=nocat, tag=tag, notag=notag, group=group, nogroup=nogroup)
if res:
......
......
......@@ -54,7 +54,7 @@ CREATE TABLE IF NOT EXISTS `clients` (
`write` tinyint(1) NOT NULL DEFAULT '0',
`test` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 DEFAULT COLLATE utf8_unicode_ci AUTO_INCREMENT=31 ;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 DEFAULT COLLATE utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
......
......
{
"Log": {
# If not specified, FileLogger is default
// If not specified, FileLogger is default
"level": "debug"
},
"Handler": {
"send_events_limit": 500,
"get_events_limit": 1000,
"description": "Warden 3 not even alpha development server"
"description": "Warden 3 distribution config"
}
}
\ No newline at end of file
......@@ -17,10 +17,7 @@ import MySQLdb.cursors as mycursors
import re
import email.utils
from collections import namedtuple
from uuid import uuid4
from time import time, gmtime, sleep
from math import trunc
from io import BytesIO
from time import sleep
from urlparse import parse_qs
from os import path
from random import randint
......@@ -31,7 +28,7 @@ sys.path.append(path.join(path.dirname(__file__), "..", "lib"))
from jsonschema import Draft4Validator
VERSION = "3.0-beta0"
VERSION = "3.0-beta1"
class Error(Exception):
......@@ -859,7 +856,7 @@ class Server(ObjectReq):
class WardenHandler(ObjectReq):
def __init__(self, req, validator, db, auth,
send_events_limit=100000, get_events_limit=100000,
send_events_limit=500, get_events_limit=1000,
description=None):
ObjectReq.__init__(self, req)
......@@ -1151,8 +1148,8 @@ def build_server(conf):
"validator": {"type": obj, "default": "validator"},
"db": {"type": obj, "default": "DB"},
"auth": {"type": obj, "default": "auth"},
"send_events_limit": {"type": natural, "default": 10000},
"get_events_limit": {"type": natural, "default": 10000},
"send_events_limit": {"type": natural, "default": 500},
"get_events_limit": {"type": natural, "default": 1000},
"description": {"type": str, "default": ""}
},
"Server": {
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment