Ottomata has submitted this change and it was merged.

Change subject: Two fixes to rolematcher.py
......................................................................


Two fixes to rolematcher.py

Change-Id: I13b481707feafac3bd09188ae80a07ff6bc8b8a8
---
M files/misc/PacketLossLogtailer.py
M files/misc/rolematcher.py
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Ottomata: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/files/misc/PacketLossLogtailer.py 
b/files/misc/PacketLossLogtailer.py
index 4c2c2f9..42e3d99 100644
--- a/files/misc/PacketLossLogtailer.py
+++ b/files/misc/PacketLossLogtailer.py
@@ -27,12 +27,12 @@
     def __init__(self):
         '''This function should initialize any data structures or variables
         needed for the internal state of the line parser.'''
+        self.last_update_time = time.time()
         self.reset_state()
         self.lock = threading.RLock()
         # a list of rolematchers which are simple object to determine the role 
of a particular server
         # this list is obtained from crawling noc.wikimedia.org/pybal and 
parse the available configurations
         self.day_in_seconds = 24 * 60 * 60
-        self.last_update_time = time.time()
         self.matchers = rolematcher.init()
         # this is what will match the packet loss lines
         # packet loss format :
diff --git a/files/misc/rolematcher.py b/files/misc/rolematcher.py
index 1a4dd6d..db3024e 100644
--- a/files/misc/rolematcher.py
+++ b/files/misc/rolematcher.py
@@ -204,11 +204,11 @@
 
 
 if __name__ == '__main__':
-    if len(sys.argv) != 1:
+    if len(sys.argv) != 2:
         print 'Please specify path to packetloss log file, call this file only 
for testing purposes.'
         sys.exit(-1)
     else:
-        path = sys.argv[0]
+        path = sys.argv[1]
 
     matchers = init()
     line_matcher = re.compile('^\[(?P<date>[^]]+)\] (?P<server>[^ ]+) lost: 
\((?P<percentloss>[^ ]+) \+\/- (?P<margin>[^)]+)\)%')

-- 
To view, visit https://gerrit.wikimedia.org/r/63668
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I13b481707feafac3bd09188ae80a07ff6bc8b8a8
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Diederik <dvanli...@wikimedia.org>
Gerrit-Reviewer: Ottomata <o...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to