pcp
[Top] [All Lists]

Little pmrep regression

To: Marko Myllynen <myllynen@xxxxxxxxxx>
Subject: Little pmrep regression
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Thu, 10 Dec 2015 20:37:06 -0500 (EST)
Cc: PCP <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: 1bmY6wZrbyV+TmGfbm9ZBD7Hi/gLXw==
Thread-topic: Little pmrep regression
Hi Marko,

Seeing a qa/1069 failure after last batch of fixes...

--- 1069.out    2015-12-10 17:03:52.000000000 +1100
+++ 1069.out.bad        2015-12-10 19:56:25.848128234 +1100
@@ -1,9 +1,13 @@
 QA output created by 1069
 == basic live mode reporting
-          s.l.one
-                 
-HH:MM:SS      N/A
-HH:MM:SS        1
+Traceback (most recent call last):
+  File "/bin/pmrep", line 1320, in <module>
+    P.connect()
+  File "/bin/pmrep", line 1313, in connect
+    self.context = pmapi.pmContext.fromOptions(self.opts, sys.argv, 
self.opts.pmGetOptionContext())
+  File "/usr/lib64/python3.3/site-packages/pcp/pmapi.py", line 1086, in 
fromOptions
+    if (typed <= 0):
+TypeError: unorderable types: NoneType() <= int()
 == basic archive mode reporting
           s.seconds  s.milliseconds
                util            util

Looks like commit 876645e03864 introduces a possibility for a None
to be passed into the typed param of pmapi.pmContext.fromOptions()
... backing out the part of the change below resolves it for me.

diff --git a/src/pmrep/pmrep.py b/src/pmrep/pmrep.py
index dd2230d..9ab3a04 100644
--- a/src/pmrep/pmrep.py
+++ b/src/pmrep/pmrep.py
@@ -1310,7 +1310,7 @@ class PMReporter(object):
 
     def connect(self):
         """ Establish a PMAPI context to archive, host or local, via args """
-        self.context = pmapi.pmContext.fromOptions(self.opts, sys.argv, 
self.opts.pmGetOptionContext())
+        self.context = pmapi.pmContext.fromOptions(self.opts, sys.argv)
 
 if __name__ == '__main__':
     try:

I've added some more guards into the python api code and this now passes;
also added a pmrep workaround for the GNU-style options bug you found the
other day, this'll need a more invasive fix later though I think, so I'll
leave the bug open for now.

cheers.

--
Nathan

<Prev in Thread] Current Thread [Next in Thread>