Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions contrib/python/compare_RecordsConfigcc.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
Expand All @@ -23,8 +23,8 @@
try:
src_dir = sys.argv[1]
except IndexError:
print "Usage: %s [trafficserver_source_dir]" % sys.argv[0]
print "Compares values in RecordsConfig.cc with the default records.config file"
print("Usage: %s [trafficserver_source_dir]" % sys.argv[0])
print("Compares values in RecordsConfig.cc with the default records.config file")
sys.exit(1)

# We expect these keys to differ between files, so ignore them
Expand Down Expand Up @@ -52,12 +52,12 @@
m = cc_re.search(line)
if m:
value = m.group(3)
value = string.lstrip(value, '"')
value = string.rstrip(value, '"')
value = value.lstrip('"')
value = value.rstrip('"')
rc_cc[m.group(1)] = (m.group(2), value)

# Process records.config.default.in
with open("%s/proxy/config/records.config.default.in" % src_dir) as fh:
with open("%s/configs/records.config.default.in" % src_dir) as fh:
in_re = re.compile(r'(?:CONFIG|LOCAL) (\S+)\s+(\S+)\s+(\S+)')
for line in fh:
m = in_re.match(line)
Expand All @@ -77,37 +77,37 @@
# Compare the two
# If a value is in RecordsConfig.cc and not records.config.default.in, it is
# ignored right now.
print "# Comparing RecordsConfig.cc -> records.config.default.in"
print("# Comparing RecordsConfig.cc -> records.config.default.in")
for key in rc_in:
if key in ignore_keys:
continue
if key not in rc_cc:
print "%s missing -> %s" % (key, "%s %s" % rc_in[key])
print("%s missing -> %s" % (key, "%s %s" % rc_in[key]))
continue
if rc_cc[key] != rc_in[key]:
print "%s : %s -> %s" % (key, "%s %s" % rc_cc[key], "%s %s" % rc_in[key])
print("%s : %s -> %s" % (key, "%s %s" % rc_cc[key], "%s %s" % rc_in[key]))

# Search for undocumented variables ...
missing = [k for k in rc_cc if k not in rc_doc]
if len(missing) > 0:
print
print "Undocumented configuration variables:"
print()
print("Undocumented configuration variables:")
for m in sorted(missing):
print "\t%s %s" % (m, "%s %s" % rc_cc[m])
print("\t%s %s" % (m, "%s %s" % rc_cc[m]))

# Search for incorrectly documented default values ...
defaults = [k for k in rc_cc if k in rc_doc and rc_cc[k] != rc_doc[k]]
if len(defaults) > 0:
print
print "Incorrectly documented defaults:"
print()
print("Incorrectly documented defaults:")
for d in sorted(defaults):
print "\t%s %s -> %s" % (d, "%s %s" % rc_cc[d], "%s %s" % rc_doc[d])
print("\t%s %s -> %s" % (d, "%s %s" % rc_cc[d], "%s %s" % rc_doc[d]))


# Search for stale documentation ...
stale = [k for k in rc_doc if k not in rc_cc]
if (len(stale) > 0):
print
print "Stale documentation:"
print()
print("Stale documentation:")
for s in sorted(stale):
print "\t%s" % (s)
print("\t%s" % (s))
4 changes: 2 additions & 2 deletions contrib/python/compare_records_config.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -61,7 +61,7 @@ def compare_settings(old, new):
# Skip predefined values
continue
if old[key] != new[key]:
print "%s %s -> %s" % (key, old[key], new[key])
print("%s %s -> %s" % (key, old[key], new[key]))


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion tools/check-unused-dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand Down