[Git][NTPsec/ntpsec][master] ntpkeygen: fix pylint nits.

Gary E. Miller gitlab at mg.gitlab.com
Fri Sep 28 23:41:08 UTC 2018


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
57dcd097 by Gary E. Miller at 2018-09-28T23:39:12Z
ntpkeygen: fix pylint nits.

- - - - -


1 changed file:

- ntpclients/ntpkeygen.py


Changes:

=====================================
ntpclients/ntpkeygen.py
=====================================
@@ -1,21 +1,22 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
-#
-# ntpkeygen - generate cryptographic keys for NTP clients and servers
-#
-# All file names are like "ntpkey_<type>_<hostname>.<filestamp>", where
-# <type> is the file type, <hostname> the generating host name and
-# <filestamp> the generation time in NTP seconds. The NTP programs
-# expect generic names such as "ntpkey_<type>_whimsy.udel.edu" with the
-# association maintained by soft links. Following is a list of file
-# types.
-#
-# ntpkey_AES_<hostname>.<filestamp>
-# AES (128-bit) keys used to compute CMAC mode authentcation
-# using shared key cryptography
+'''
+ntpkeygen - generate cryptographic keys for NTP clients and servers
+
+All file names are like "ntpkey_<type>_<hostname>.<filestamp>", where
+<type> is the file type, <hostname> the generating host name and
+<filestamp> the generation time in NTP seconds. The NTP programs
+expect generic names such as "ntpkey_<type>_whimsy.udel.edu" with the
+association maintained by soft links. Following is a list of file
+types.
+
+ntpkey_AES_<hostname>.<filestamp>
+AES (128-bit) keys used to compute CMAC mode authentcation
+using shared key cryptography
 
-# The file can be edited by hand to support MD5 and SHA1 for
-# old digest mode authentcation.
+The file can be edited by hand to support MD5 and SHA1 for
+old digest mode authentcation.
+'''
 
 from __future__ import print_function
 
@@ -34,9 +35,9 @@ NUMKEYS = 10    # number of keys generated of each type
 KEYSIZE = 16    # maximum key size
 
 
-def gen_keys(id, groupname):
+def gen_keys(ident, groupname):
     "Generate semi-random AES keys for versions of ntpd with CMAC support."
-    with fheader("AES", id, groupname) as wp:
+    with fheader("AES", ident, groupname) as wp:
         for i in range(1, NUMKEYS+1):
             key = ""
             for j in range(KEYSIZE):
@@ -56,12 +57,13 @@ def gen_keys(id, groupname):
 #
 # Generate file header and link
 #
-def fheader(file,       # file name id
+def fheader(fileid,     # file name id
             ulink,      # linkname
             owner       # owner name
             ):
+    "Generate file header and link"
     try:
-        filename = "ntpkey_%s_%s.%u" % (file, owner, int(time.time()))
+        filename = "ntpkey_%s_%s.%u" % (fileid, owner, int(time.time()))
         orig_umask = os.umask(stat.S_IWGRP | stat.S_IRWXO)
         wp = open(filename, "w")
         os.umask(orig_umask)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/57dcd09782761bfaa4ea8b3a67cc278a7530dece

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/57dcd09782761bfaa4ea8b3a67cc278a7530dece
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/20180928/5a570f2a/attachment-0001.html>


More information about the vc mailing list