Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12423 )

Change subject: ctrl2cgi: update comments
......................................................................

ctrl2cgi: update comments

* remove obsolete comments
* add missing function comments

Change-Id: I5ace594adbccf7ce7eda2c19aa639a4f46285c25
---
M scripts/ctrl2cgi.py
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  tnt: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/scripts/ctrl2cgi.py b/scripts/ctrl2cgi.py
index 3226c1d..2cf386c 100755
--- a/scripts/ctrl2cgi.py
+++ b/scripts/ctrl2cgi.py
@@ -29,7 +29,7 @@
 import json
 import configparser
 from functools import partial
-from distutils.version import StrictVersion as V # FIXME: use 
NormalizedVersion from PEP-386 when available
+from distutils.version import StrictVersion as V
 from twisted.internet import defer, reactor
 from treq import post, collect
 from osmopy.trap_helper import debug_init, get_type, get_r, p_h, make_params, 
comm_proc
@@ -58,6 +58,9 @@
     comm_proc(decoded.get('commands'), bid, f, log)

 def gen_hash(params, skey):
+    """
+    Make mandatory parameter for http request
+    """
     inp = ''
     for key in ['time_stamp', 'position_validity', 'admin_status', 
'policy_status']:
         inp += str(params.get(key))
@@ -67,10 +70,12 @@
     m = hashlib.md5()
     m.update(inp.encode('utf-8'))
     res = m.hexdigest()
-    #print('HASH: \nparams="%r"\ninput="%s" \nres="%s"' %(params, input, res))
     return res

 def make_async_req(ts, dst, par, f_write, f_log, tout):
+    """
+    Assemble deferred request parameters and partially instantiate response 
handler
+    """
     d = post(dst, par, timeout=tout)
     d.addCallback(collect, partial(handle_reply, ts, datetime.datetime.now(), 
par['bsc_id'], f_write, f_log))
     d.addErrback(lambda e: f_log.critical("HTTP POST error %s while trying to 
register BSC %s on %s (timeout %d)" % (repr(e), par['bsc_id'], dst, tout))) # 
handle HTTP errors

--
To view, visit https://gerrit.osmocom.org/12423
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5ace594adbccf7ce7eda2c19aa639a4f46285c25
Gerrit-Change-Number: 12423
Gerrit-PatchSet: 1
Gerrit-Owner: Max <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: tnt <[email protected]>

Reply via email to