[Git][NTPsec/ntpsec][master] 7 commits: Add usage for ntpmon
Eric S. Raymond
gitlab at mg.gitlab.com
Fri Dec 9 05:33:34 UTC 2016
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
874be6b2 by Matt Selsky at 2016-12-09T00:18:07-05:00
Add usage for ntpmon
Error message:
Traceback (most recent call last):
File "./ntpclients/ntpmon", line 66, in <module>
sys.stderr.write(usage)
NameError: name 'usage' is not defined
- - - - -
711adb16 by Matt Selsky at 2016-12-09T00:18:07-05:00
ntpmon -a needs to set showall to True
- - - - -
170e533d by Matt Selsky at 2016-12-09T00:18:07-05:00
Upgrade waf to 0.9.6-dbcda7ec6a52a88c7a605a357eb5713438ac2704
Upstream waf fixed an incompatibility with Python 2.6.4 related to the
subprocess module and multiple AttributeException being thrown.
See https://github.com/waf-project/waf/issues/1874 for additional information
Fixes GitLab issue #198
- - - - -
2c9bf2b6 by Matt Selsky at 2016-12-09T00:18:07-05:00
Now that waf is fixed, revert minimum Python 2.6 back to 2.6.0
Reverts "Change pre-requisites to indicate Python 2 must be at 2.6.6 or later."
- - - - -
348e03f2 by Matt Selsky at 2016-12-09T00:22:29-05:00
Rename collections variable
Leftover cleanup from "Address GitLab issue #197: ntpq and packet.py require
python2.7+"
- - - - -
ca70ba18 by Matt Selsky at 2016-12-09T00:25:00-05:00
Don't name exceptions if you never reference them
pyflakes reported:
pylib/packet.py:934: local variable 'msg' is assigned to but never used
pylib/packet.py:961: local variable 'reason' is assigned to but never used
- - - - -
364df24f by Matt Selsky at 2016-12-09T00:29:09-05:00
Remove ntpq references from ntpmon man page
Also document long options in the synopsis
- - - - -
7 changed files:
- INSTALL
- devel/hacking.txt
- docs/includes/ntpmon-body.txt
- ntpclients/ntpmon
- pylib/packet.py
- pylib/wscript
- waf
Changes:
=====================================
INSTALL
=====================================
--- a/INSTALL
+++ b/INSTALL
@@ -12,7 +12,7 @@ via getifaddrs(3) or some equivalent facility.
There are some prerequisites. Libraries need the binary installed
to run and in addition, the development headers installed to build.
-Python 2.x.y, x.y >= 6.6, or Python 3.x, x >= 3::
+Python 2.x, x >= 6, or Python 3.x, x >= 3::
Required to build, and for various scripts such as ntpviz (but see
the guidance for packagers in devel/packaging.txt). Our Python code
has been written polyglot to also run with production versions of
=====================================
devel/hacking.txt
=====================================
--- a/devel/hacking.txt
+++ b/devel/hacking.txt
@@ -177,7 +177,7 @@ the compiler and toolchain have been modernized.
== Python guidelines ==
-You may assume Python 2 at 2.6.6 or later, or Python 3 at 3.3 or later.
+You may assume Python 2 at 2.6 or later, or Python 3 at 3.3 or later.
Please read https://www.python.org/dev/peps/pep-0008/[PEP 8] and use
that style. The only PEP 8 style rule we relax is that you may
=====================================
docs/includes/ntpmon-body.txt
=====================================
--- a/docs/includes/ntpmon-body.txt
+++ b/docs/includes/ntpmon-body.txt
@@ -4,7 +4,7 @@
== Synopsis ==
-+ntpmon+ [-a] [-n] [-w] [hostname]
++ntpmon+ [-a | --all] [-n | --numeric] [-w | --wide] [hostname]
== Description ==
@@ -20,10 +20,7 @@ polling interval reported in the last peers response.)
== Options ==
-Command line options are described following. Specifying a command line
-option other than +-i+ or +-n+ will cause the specified query (queries)
-to be sent to the indicated host(s) immediately. Otherwise, +ntpq+ will
-attempt to read interactive format commands from the standard input.
+Command line options are described following.
+-a+, +--all+::
Show all hosts, not just reachable ones.
=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -49,6 +49,14 @@ class OutputContext:
def __exit__(self, extype_unused, value_unused, traceback_unused):
curses.endwin()
+usage = '''
+USAGE: ntpmon [-anw] [--all] [--numeric] [--wide] [ host ]
+ Flg Arg Option-Name Description
+ -a no all Show all hosts, not just reachable ones.
+ -n no numeric numeric host addresses
+ -w no wide enable wide display of addresses
+'''
+
if __name__ == '__main__':
try:
(options, arguments) = getopt.getopt(sys.argv[1:],
@@ -64,7 +72,7 @@ if __name__ == '__main__':
showall = False
for (switch, val) in options:
if switch in ("-a", "--all"):
- showall = False
+ showall = True
elif switch in ("-n", "--numeric"):
showhostnames = False
elif switch in ("-w", "--wide"):
=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -931,7 +931,7 @@ class ControlSession:
warn("At %s, select with timeout %d begins\n" % (time.asctime(), tvo))
try:
(rd, _, _) = select.select([self.sock], [], [], tvo)
- except select.error as msg:
+ except select.error:
raise ControlException(SERR_SELECT)
if self.debug > 4:
warn("At %s, select with timeout %d ends\n" % (time.asctime(), tvo))
@@ -958,7 +958,7 @@ class ControlSession:
rpkt = ControlPacket(self)
try:
rpkt.analyze(rawdata)
- except struct.error as reason:
+ except struct.error:
raise ControlException(SERR_UNSPEC)
if rpkt.version() > ntp.magic.NTP_VERSION or rpkt.version() < ntp.magic.NTP_OLDVERSION:
@@ -1400,7 +1400,7 @@ class ControlSession:
stanza = int(stanza)
if stanza > len(stanzas) - 1:
for i in range(len(stanzas), stanza + 1):
- stanzas.append(collections.OrderedDict())
+ stanzas.append(ntp.util.OrderedDict())
stanzas[stanza][stem] = value
return stanzas
=====================================
pylib/wscript
=====================================
--- a/pylib/wscript
+++ b/pylib/wscript
@@ -3,7 +3,7 @@ def options(opt):
def configure(conf):
conf.load('python')
- conf.check_python_version((2, 6, 6))
+ conf.check_python_version((2, 6, 0))
conf.check_python_headers()
def build(ctx):
=====================================
waf
=====================================
The diff for this file was not included because it is too large.
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/f31ec4bbd6e819c0fe4632d35fb2a293b19399d5...364df24f8d53b246ec91116ac3258c2946c7f294
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161209/4f28eda2/attachment.html>
More information about the vc
mailing list