[Git][NTPsec/ntpsec][master] Moved slicedata() from agentx.py to util.py
Ian Bruene
gitlab at mg.gitlab.com
Wed Aug 23 16:34:48 UTC 2017
Ian Bruene pushed to branch master at NTPsec / ntpsec
Commits:
3072e7d6 by Ian Bruene at 2017-08-23T11:33:14-05:00
Moved slicedata() from agentx.py to util.py
- - - - -
2 changed files:
- pylib/agentx.py
- pylib/util.py
Changes:
=====================================
pylib/agentx.py
=====================================
--- a/pylib/agentx.py
+++ b/pylib/agentx.py
@@ -5,6 +5,7 @@
from __future__ import print_function
import struct
+from ntp.util import slicedata
internetPrefix = (1, 3, 6, 1) # Used by the prefix option of OID headers
prefixCount = len(internetPrefix)
@@ -922,10 +923,6 @@ def getendian(bigEndian):
return ">" if bigEndian is True else "<"
-def slicedata(data, slicepoint):
- return data[:slicepoint], data[slicepoint:]
-
-
def isnullOID(oid):
if (len(oid["subids"]) == 0) and (oid["include"] is False):
return True
=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -96,6 +96,10 @@ def rfc3339(t):
return rep
+def slicedata(data, slicepoint):
+ return data[:slicepoint], data[slicepoint:]
+
+
def portsplit(hostname):
portsuffix = ""
if hostname.count(":") == 1: # IPv4 with appended port
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/3072e7d6864af8a442ab366f179c82cb11f04e81
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/3072e7d6864af8a442ab366f179c82cb11f04e81
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/20170823/49159edb/attachment.html>
More information about the vc
mailing list