[Git][NTPsec/ntpsec][master] Fix a minor glitch in processing of config_from_file...

Eric S. Raymond gitlab at mg.gitlab.com
Tue Aug 22 09:54:25 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
291407ea by Eric S. Raymond at 2017-08-22T05:52:05-04:00
Fix a minor glitch in processing of config_from_file...

...and document the results of Python not accepting hyphens in commands.

- - - - -


2 changed files:

- docs/includes/ntpq-body.txt
- ntpclients/ntpq


Changes:

=====================================
docs/includes/ntpq-body.txt
=====================================
--- a/docs/includes/ntpq-body.txt
+++ b/docs/includes/ntpq-body.txt
@@ -558,6 +558,10 @@ It is possible for a "config unpeer" command to fail silently, yielding
 a driver type name or a hostname not present in the peer list. The
 error will however be reported in the system log.
 
+Any error messages from failed ":config" and "config-from-file" will have
+slightly confusing prefixes. This is due to a limitation in the Python
+Cmd.Cmd library and cannot practically be fixed.
+
 The config command cannot be used to change a server's default restrictions.
 
 include::mrufail.txt[]


=====================================
ntpclients/ntpq
=====================================
--- a/ntpclients/ntpq
+++ b/ntpclients/ntpq
@@ -179,7 +179,7 @@ class Ntpq(cmd.Cmd):
         if line.startswith(":config"):
             line = "hot_" + line[1:]
         elif line.startswith("config-from-file"):
-            line = line.replace("config-from-file ", "config_from_file")
+            line = line.replace("config-from-file", "config_from_file")
 
         cmd, arg, line = self.parseline(line)
         try:
@@ -1258,7 +1258,7 @@ usage: config <configuration command line>
         "configure ntpd using the configuration filename"
         try:
             with open(line) as rfp:
-                self.say(self.session.config(rfp.read()))
+                self.say("%s\n" % self.session.config(rfp.read()))
         except IOError:
             self.warn("Could not read %s\n" % line)
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/291407ea9e9e20f75b46912cf43ac9bc2ef107d6

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/291407ea9e9e20f75b46912cf43ac9bc2ef107d6
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170822/5d017503/attachment.html>


More information about the vc mailing list