log server URL in windows registry
authorOliver Maurhart <oliver.maurhart@ait.ac.at>
Mon, 19 May 2014 16:08:30 +0200
changeset 158316f9a5be7e5
parent 157 f540d6673499
child 159 30947d377e7c
child 160 c014a9db4b55
log server URL in windows registry
OpenSecurity/bin/opensecurity_client_restful_server.py
     1.1 --- a/OpenSecurity/bin/opensecurity_client_restful_server.py	Mon May 19 15:45:15 2014 +0200
     1.2 +++ b/OpenSecurity/bin/opensecurity_client_restful_server.py	Mon May 19 16:08:30 2014 +0200
     1.3 @@ -556,11 +556,13 @@
     1.4      @param  log     the log POST param
     1.5      """
     1.6  
     1.7 -    url_addr = 'http://GIMME-SERVER-TO-LOG-TO/log'
     1.8 +    key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, 'SOFTWARE\OpenSecurity')
     1.9 +    log_server_url = str(win32api.RegQueryValueEx(key, 'LogServerURL')[0])
    1.10 +    win32api.RegCloseKey(key)
    1.11  
    1.12      # by provided a 'data' we turn this into a POST statement
    1.13      d = urllib.urlencode(log)
    1.14 -    req = urllib2.Request(url_addr, d)
    1.15 +    req = urllib2.Request(log_server_url, d)
    1.16      urllib2.urlopen(req)
    1.17      logger.debug('pushed log to server: ' + str(log))
    1.18