Python ntpq

Achim Gratz Stromeko at nexgo.de
Sun Nov 27 12:24:05 UTC 2016


Eric S. Raymond writes:
> ...or maybe not.  Rather klugey fix pushed.  Complain if it needs
> futher work.

Breaks as follows:

pi at raspberrypi2:~/ntpsec $ ntpq/ntpq -p -c "cv &1" -c "cv &2"
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 NMEA(0)         .uBx8.           0 l   10   16  377    0.000   -4.070   2.224
oNMEA(1)         .NavS.           0 l    9   16  377    0.000   -0.001   0.003
 ptbtime1.ptb.de .PTB.            1 u    9   64  377   27.571    0.751   0.081
 ptbtime2.ptb.de .PTB.            1 u   18   64  377   27.396    0.783   0.098
 ptbtime3.ptb.de .PTB.            1 u    -   64  377   25.930    0.111   0.132
Traceback (most recent call last):
  File "ntpq/ntpq", line 1590, in <module>
    interpreter.onecmd(cmd)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "ntpq/ntpq", line 1082, in do_cv
    self.do_clockvar(line)
  File "ntpq/ntpq", line 1072, in do_clockvar
    self.__dolist(line.split()[1:], assoc, ntp.packet.CTL_OP_READCLOCK, ntp.ntpc.TYPE_CLOCK)
  File "ntpq/ntpq", line 456, in __dolist
    variables = self.session.readvar(associd, varlist, op)
  File "/usr/lib/python2.7/dist-packages/ntp/packet.py", line 1139, in readvar
    return collections.OrderedDict(items)
  File "/usr/lib/python2.7/dist-packages/ntp/packet.py", line 1110, in __parse_varlist
    response += c
TypeError: 'str' object does not support item assignment


Also, it seems that association indices can't be used if you do not
print any peer list:

pi at raspberrypi2:~/ntpsec $ ntpq/ntpq -c "cv &1" -c "cv &2"
No such index.
No such index.

I havent tracked when it was broken, but I assume this is a missing
initialization and was always there.


Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs



More information about the devel mailing list