[master] 3726b255f Start being a little bit annoying about STRING_LIST going away

Poul-Henning Kamp phk at FreeBSD.org
Thu Jun 20 09:28:08 UTC 2019


commit 3726b255f89dc84a40538edbebc560654a9f5ad5
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Jun 20 09:22:03 2019 +0000

    Start being a little bit annoying about STRING_LIST going away

diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index d431df1cf..79cff3ee8 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -42,6 +42,7 @@ import unittest
 import copy
 import json
 import hashlib
+import time
 
 AMBOILERPLATE = '''
 # Generated by vmodtool.py --boilerplate.
@@ -117,6 +118,22 @@ CTYPES = {
 
 CTYPES.update(PRIVS)
 
+DEPRECATED = {}
+
+#######################################################################
+
+def deprecated(key, txt):
+    '''
+       Be annoying about features which are going away
+    '''
+    if DEPRECATED.get(key):
+        return
+    sys.stderr.write('#' * 72 + '\n')
+    sys.stderr.write(txt + '\n')
+    sys.stderr.write('#' * 72 + '\n')
+    time.sleep(3)
+    DEPRECATED[key] = True
+
 #######################################################################
 
 def is_quoted(txt):
@@ -213,6 +230,12 @@ class CType(object):
         self.opt = False
 
         self.vt = wl.pop(0)
+        if self.vt == "STRING_LIST":
+            deprecated("STRING_LIST", '''
+STRING_LIST will be discontinued before the 2019-09-15 release
+
+Please switch to STRANDS
+''')
         self.ct = CTYPES.get(self.vt)
         if self.ct is None:
             err("Expected type got '%s'" % self.vt, warn=False)
@@ -774,7 +797,7 @@ class ObjectStanza(Stanza):
         ll = [
             "$OBJ",
             self.proto.name,
-	    { "NULL_OK": self.null_ok },
+            {"NULL_OK": self.null_ok},
             "struct %s%s_%s" %
             (self.vcc.sympfx, self.vcc.modname, self.proto.name),
         ]


More information about the varnish-commit mailing list