[Git][NTPsec/ntpsec][master] Change an insufficiently specific member name.

Eric S. Raymond gitlab at mg.gitlab.com
Sun Oct 23 13:15:42 UTC 2016


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


Commits:
e83e306e by Eric S. Raymond at 2016-10-23T09:15:16-04:00
Change an insufficiently specific member name.

- - - - -


2 changed files:

- ntpq/pyntpq
- pylib/packet.py


Changes:

=====================================
ntpq/pyntpq
=====================================
--- a/ntpq/pyntpq
+++ b/ntpq/pyntpq
@@ -231,7 +231,7 @@ usage: help [ command ]
 
         if len(self.peers) == 0:
             if self.chosts:
-                sys.stdout.write("server=%s ", self.session.name)
+                sys.stdout.write("server=%s ", self.session.hostname)
             sys.stdout.write("No association IDs returned\n")
             return False
 
@@ -495,7 +495,7 @@ usage: help [ command ]
             return False
         if not variables:
             if len(self.chosts) > 1:
-                sys.stderr.write("server=%s ", self.session.name)
+                sys.stderr.write("server=%s ", self.session.hostname)
             sys.stderr.write("***No information returned for association %d\n" \
                              % associd)
             return False;
@@ -507,7 +507,7 @@ usage: help [ command ]
             return
         maxhostlen = 0
 	#for host in self.chosts:
-        #    if getnetnum(chosts[u].name, &netnum, fullname, af):
+        #    if getnetnum(chosts[u].hostname, &netnum, fullname, af):
         #        name_or_num = nntohost(&netnum)
         #        sl = len(name_or_num)
         #        maxhostlen = max(maxhostlen, sl)
@@ -621,7 +621,7 @@ usage: delay [ msec ]
         "specify the host whose NTP server we talk to"
         if not line:
             if self.session.havehost():
-                print("current host is %s" % self.session.name)
+                print("current host is %s" % self.session.hostname)
             else:
                 print("no current host")
         else:
@@ -633,9 +633,9 @@ usage: delay [ msec ]
                 session.ai_family = socket.AF_INET6
                 tokens.pop(0)
             if tokens and self.session.openhost(tokens[0], session.ai_family):
-                print("current host set to %s" % self.session.name)
+                print("current host set to %s" % self.session.hostname)
             elif self.session.havehost():
-                print("current host remains %s" % self.session.name)
+                print("current host remains %s" % self.session.hostname)
             else:
                 print("still no current host")
 


=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -281,7 +281,7 @@ class Mode6Session:
         self.always_auth       = False  # Always send authenticated requests
         self.keyid = None
         self.password = None
-        self.name = None
+        self.hostname = None
         self.isnum = False
         self.sock = None
         self.port = 0
@@ -350,13 +350,13 @@ class Mode6Session:
         # C implementation didn't use multiple responses, so we don't either
         (family, socktype, protocol, canonname, sockaddr) = res[0]
         if canonname is None:
-            self.name = sockaddr.inet_ntop(sockaddr[0], family)
+            self.hostname = sockaddr.inet_ntop(sockaddr[0], family)
             self.isnum = True
         else:
-            self.name = canonname or hname
+            self.hostname = canonname or hname
             self.isnum = False
         if self.debug > 2:
-            sys.stdout.write("Opening host %s\n" % self.name)
+            sys.stdout.write("Opening host %s\n" % self.hostname)
         self.port = sockaddr[1]
         try:
             self.sock = socket.socket(family, socktype, protocol)
@@ -380,7 +380,7 @@ class Mode6Session:
             self.sock.sendall(polybytes(xdata))
         except socket.error:
             # On failure, we don't know how much data was actually received
-            sys.stderr.write("Write to %s failed\n" % self.name)
+            sys.stderr.write("Write to %s failed\n" % self.hostname)
             return -1
         if self.debug >= 4:
             sys.stdout.write("Request packet:\n")
@@ -446,10 +446,10 @@ class Mode6Session:
                 # Timed out.  Return what we have
                 if len(fragments) == 0:
                     if timeo:
-                        warn("%s: timed out, nothing received\n" % self.name)
+                        warn("%s: timed out, nothing received\n" % self.hostname)
                         raise Mode6Exception(SERR_TIMEOUT)
                 if timeo:
-                    warn("%s: timed out with incomplete data\n" % self.name)
+                    warn("%s: timed out with incomplete data\n" % self.hostname)
                     if self.debug:
                         sys.stderr.write("ERR_INCOMPLETE: Received fragments:\n")
                         for (i, frag) in enumerate(fragments):



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/e83e306edd540002a4a9b629887be88141fd6e3c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161023/86fff66f/attachment.html>


More information about the vc mailing list