You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by rr...@apache.org on 2020/05/04 14:55:57 UTC

[trafficserver] branch master updated (59ff1d8 -> 005b04b)

This is an automated email from the ASF dual-hosted git repository.

rrm pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


    from 59ff1d8  Fix ink_endian.h to include an appropriate header file
     new 35f63f5  python: Remove unnecessary comprehension
     new d1efcb4  python: Remove unused variables
     new 2178bcf  python: Fix dangerous default argument
     new 005b04b  python: Remove unused imports

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/checkvers.py                                               |  3 +--
 doc/conf.py                                                    |  2 --
 doc/ext/traffic-server.py                                      | 10 +++++++---
 doc/manpages.py                                                |  1 -
 plugins/experimental/traffic_dump/post_process.py              |  2 +-
 tests/gold_tests/chunked_encoding/chunked_encoding_h2.test.py  |  1 -
 tests/gold_tests/h2/h2active_timeout.py                        |  2 +-
 tests/gold_tests/h2/h2chunked.py                               |  2 +-
 tests/gold_tests/headers/forwarded.test.py                     |  1 -
 .../cache_range_requests/cache_range_requests.test.py          |  2 --
 .../cache_range_requests/cache_range_requests_cachekey.test.py |  3 ---
 .../cache_range_requests/cache_range_requests_ims.test.py      |  1 -
 tests/gold_tests/pluginTest/lua/lua_states_stats.test.py       |  1 -
 tests/gold_tests/pluginTest/lua/lua_watermark.test.py          |  1 -
 tests/gold_tests/pluginTest/uri_signing/uri_signing.test.py    |  2 --
 tests/gold_tests/slow_post/slow_post_client.py                 |  2 +-
 tests/gold_tests/tls/tls_verify_override_sni.test.py           |  1 -
 17 files changed, 12 insertions(+), 25 deletions(-)


[trafficserver] 04/04: python: Remove unused imports

Posted by rr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rrm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 005b04bfbaa0381ccf214e4f781f6bf402426de0
Author: Randall Meyer <rr...@apache.org>
AuthorDate: Fri May 1 19:39:27 2020 +0000

    python: Remove unused imports
    
    Co-authored-by: deepsource-autofix[bot] <62...@users.noreply.github.com>
---
 doc/checkvers.py                                                       | 1 -
 doc/conf.py                                                            | 2 --
 doc/manpages.py                                                        | 1 -
 tests/gold_tests/chunked_encoding/chunked_encoding_h2.test.py          | 1 -
 tests/gold_tests/headers/forwarded.test.py                             | 1 -
 .../pluginTest/cache_range_requests/cache_range_requests.test.py       | 2 --
 .../cache_range_requests/cache_range_requests_cachekey.test.py         | 3 ---
 .../pluginTest/cache_range_requests/cache_range_requests_ims.test.py   | 1 -
 tests/gold_tests/pluginTest/lua/lua_states_stats.test.py               | 1 -
 tests/gold_tests/pluginTest/lua/lua_watermark.test.py                  | 1 -
 tests/gold_tests/pluginTest/uri_signing/uri_signing.test.py            | 2 --
 tests/gold_tests/tls/tls_verify_override_sni.test.py                   | 1 -
 12 files changed, 17 deletions(-)

diff --git a/doc/checkvers.py b/doc/checkvers.py
index cf1f841..30d61cd 100644
--- a/doc/checkvers.py
+++ b/doc/checkvers.py
@@ -15,7 +15,6 @@
 # limitations under the License.
 
 import sys
-import os
 
 if __name__ == '__main__':
     # Use optparse instead of argparse because this needs to work on old Python versions.
diff --git a/doc/conf.py b/doc/conf.py
index f1f5112..e9842fb 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -38,8 +38,6 @@ from sphinx import version_info
 sys.path.insert(0, os.path.abspath('ext'))
 sys.path.insert(0, os.path.abspath('.'))
 
-from manpages import man_pages
-
 # -- General configuration -----------------------------------------------------
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
diff --git a/doc/manpages.py b/doc/manpages.py
index 0e38f10..9e6cc44 100644
--- a/doc/manpages.py
+++ b/doc/manpages.py
@@ -14,7 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import sys
 import os
 
 man_pages = [
diff --git a/tests/gold_tests/chunked_encoding/chunked_encoding_h2.test.py b/tests/gold_tests/chunked_encoding/chunked_encoding_h2.test.py
index d5022c0..96af641 100644
--- a/tests/gold_tests/chunked_encoding/chunked_encoding_h2.test.py
+++ b/tests/gold_tests/chunked_encoding/chunked_encoding_h2.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test interaction of H2 and chunked encoding
 '''
diff --git a/tests/gold_tests/headers/forwarded.test.py b/tests/gold_tests/headers/forwarded.test.py
index 87ceeda..d2d0347 100644
--- a/tests/gold_tests/headers/forwarded.test.py
+++ b/tests/gold_tests/headers/forwarded.test.py
@@ -18,7 +18,6 @@ Test the Forwarded header and related configuration..
 #  limitations under the License.
 
 import os
-import ports
 
 Test.Summary = '''
 Test FORWARDED header.
diff --git a/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests.test.py b/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests.test.py
index 5806f14..9b0f487 100644
--- a/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests.test.py
+++ b/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-
 Test.Summary = '''
 Basic cache_range_requests plugin test
 '''
diff --git a/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests_cachekey.test.py b/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests_cachekey.test.py
index 2622694..bee7363 100644
--- a/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests_cachekey.test.py
+++ b/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests_cachekey.test.py
@@ -16,9 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import time
-
 Test.Summary = '''
 cache_range_requests with cachekey
 '''
diff --git a/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests_ims.test.py b/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests_ims.test.py
index 3c9c281..3d019db 100644
--- a/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests_ims.test.py
+++ b/tests/gold_tests/pluginTest/cache_range_requests/cache_range_requests_ims.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 import time
 
 Test.Summary = '''
diff --git a/tests/gold_tests/pluginTest/lua/lua_states_stats.test.py b/tests/gold_tests/pluginTest/lua/lua_states_stats.test.py
index af1a91a..126d026 100644
--- a/tests/gold_tests/pluginTest/lua/lua_states_stats.test.py
+++ b/tests/gold_tests/pluginTest/lua/lua_states_stats.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test lua states and stats functionality
 '''
diff --git a/tests/gold_tests/pluginTest/lua/lua_watermark.test.py b/tests/gold_tests/pluginTest/lua/lua_watermark.test.py
index a97678c..c3565a1 100644
--- a/tests/gold_tests/pluginTest/lua/lua_watermark.test.py
+++ b/tests/gold_tests/pluginTest/lua/lua_watermark.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test lua functionality
 '''
diff --git a/tests/gold_tests/pluginTest/uri_signing/uri_signing.test.py b/tests/gold_tests/pluginTest/uri_signing/uri_signing.test.py
index bdb4686..010a8f1 100644
--- a/tests/gold_tests/pluginTest/uri_signing/uri_signing.test.py
+++ b/tests/gold_tests/pluginTest/uri_signing/uri_signing.test.py
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
-import subprocess
 Test.Summary = '''
 Test uri_signing plugin
 '''
diff --git a/tests/gold_tests/tls/tls_verify_override_sni.test.py b/tests/gold_tests/tls/tls_verify_override_sni.test.py
index 38ceeb3..93ccc41 100644
--- a/tests/gold_tests/tls/tls_verify_override_sni.test.py
+++ b/tests/gold_tests/tls/tls_verify_override_sni.test.py
@@ -16,7 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import os
 Test.Summary = '''
 Test tls server certificate verification options. Exercise conf_remap
 '''


[trafficserver] 03/04: python: Fix dangerous default argument

Posted by rr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rrm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 2178bcfe3ac87eeec35be7ca648da224162b7f65
Author: Randall Meyer <rr...@apache.org>
AuthorDate: Fri May 1 19:15:21 2020 +0000

    python: Fix dangerous default argument
    
    Co-authored-by: deepsource-autofix[bot] <62...@users.noreply.github.com>
---
 doc/ext/traffic-server.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/doc/ext/traffic-server.py b/doc/ext/traffic-server.py
index 384c297..72e236e 100644
--- a/doc/ext/traffic-server.py
+++ b/doc/ext/traffic-server.py
@@ -389,7 +389,7 @@ git_branch = subprocess.check_output(['git', '--git-dir', REPO_GIT_DIR,
                                       'rev-parse', '--abbrev-ref', 'HEAD'])
 
 
-def make_github_link(name, rawtext, text, lineno, inliner, options={}, content=[]):
+def make_github_link(name, rawtext, text, lineno, inliner, options=None, content=None):
     """
     This docutils role lets us link to source code via the handy :ts:git: markup.
     Link references are rooted at the top level source directory. All links resolve
@@ -405,6 +405,10 @@ def make_github_link(name, rawtext, text, lineno, inliner, options={}, content=[
 
             If you want to contribute, take a look at :ts:git:`CONTRIBUTING.md`.
     """
+    if options is None:
+        options = {}
+    if content is None:
+        content = []
     url = 'https://github.com/apache/trafficserver/blob/{}/{}'
     ref = autoconf_version if autoconf_version == git_branch else 'master'
     node = nodes.reference(rawtext, text, refuri=url.format(ref, text), **options)


[trafficserver] 02/04: python: Remove unused variables

Posted by rr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rrm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit d1efcb490c3db090e11f7721006be5362fe52c89
Author: Randall Meyer <rr...@apache.org>
AuthorDate: Fri May 1 19:13:19 2020 +0000

    python: Remove unused variables
    
    Co-authored-by: deepsource-autofix[bot] <62...@users.noreply.github.com>
---
 doc/ext/traffic-server.py                         | 4 ++--
 plugins/experimental/traffic_dump/post_process.py | 2 +-
 tests/gold_tests/h2/h2active_timeout.py           | 2 +-
 tests/gold_tests/h2/h2chunked.py                  | 2 +-
 tests/gold_tests/slow_post/slow_post_client.py    | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/ext/traffic-server.py b/doc/ext/traffic-server.py
index 922c8ad..384c297 100644
--- a/doc/ext/traffic-server.py
+++ b/doc/ext/traffic-server.py
@@ -117,7 +117,7 @@ class TSConfVar(std.Target):
             title.set_class(self.options.get('class'))
         # This has to be a distinct node before the title. if nested then
         # the browser will scroll forward to just past the title.
-        anchor = nodes.target('', '', names=[cv_name])
+        nodes.target('', '', names=[cv_name])
         # Second (optional) arg is 'msgNode' - no idea what I should pass for that
         # or if it even matters, although I now think it should not be used.
         self.state.document.note_explicit_target(title)
@@ -241,7 +241,7 @@ class TSStat(std.Target):
 
         # This has to be a distinct node before the title. if nested then
         # the browser will scroll forward to just past the title.
-        anchor = nodes.target('', '', names=[stat_name])
+        nodes.target('', '', names=[stat_name])
         # Second (optional) arg is 'msgNode' - no idea what I should pass for that
         # or if it even matters, although I now think it should not be used.
         self.state.document.note_explicit_target(title)
diff --git a/plugins/experimental/traffic_dump/post_process.py b/plugins/experimental/traffic_dump/post_process.py
index d2dbe96..42f76d8 100755
--- a/plugins/experimental/traffic_dump/post_process.py
+++ b/plugins/experimental/traffic_dump/post_process.py
@@ -387,7 +387,7 @@ def main():
     nthreads = min(max(subdir_q.qsize(), 1), args.num_threads)
 
     # Start up the threads.
-    for i in range(nthreads):
+    for _ in range(nthreads):
         t = Thread(target=post_process,
                    args=(args.in_dir, subdir_q, args.out_dir,
                          args.num_sessions, args.no_human_readable,
diff --git a/tests/gold_tests/h2/h2active_timeout.py b/tests/gold_tests/h2/h2active_timeout.py
index 0b7d5ac..aa79cb1 100644
--- a/tests/gold_tests/h2/h2active_timeout.py
+++ b/tests/gold_tests/h2/h2active_timeout.py
@@ -32,7 +32,7 @@ def makerequest(port):
     active_timeout = 3
     request_interval = 0.1
     loop_cnt = int((active_timeout + 2) / request_interval)
-    for i in range(loop_cnt):
+    for _ in range(loop_cnt):
         try:
             conn.request('GET', '/')
             time.sleep(request_interval)
diff --git a/tests/gold_tests/h2/h2chunked.py b/tests/gold_tests/h2/h2chunked.py
index 97938ec..a7fee07 100644
--- a/tests/gold_tests/h2/h2chunked.py
+++ b/tests/gold_tests/h2/h2chunked.py
@@ -41,7 +41,7 @@ def makerequest(port, _url):
 
     sites = {'/'}
     request_ids = []
-    for site in sites:
+    for _ in sites:
         request_id = conn.request('GET', url=_url)
         request_ids.append(request_id)
 
diff --git a/tests/gold_tests/slow_post/slow_post_client.py b/tests/gold_tests/slow_post/slow_post_client.py
index a132a67..47fb4b4 100644
--- a/tests/gold_tests/slow_post/slow_post_client.py
+++ b/tests/gold_tests/slow_post/slow_post_client.py
@@ -34,7 +34,7 @@ def slow_post(port, slow_time):
 
 def makerequest(port, connection_limit):
     client_timeout = 3
-    for i in range(connection_limit):
+    for _ in range(connection_limit):
         t = threading.Thread(target=slow_post, args=(port, client_timeout + 10))
         t.daemon = True
         t.start()


[trafficserver] 01/04: python: Remove unnecessary comprehension

Posted by rr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rrm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 35f63f5c3a1d4cc95921459725eeb6498bd678b3
Author: Randall Meyer <rr...@apache.org>
AuthorDate: Fri May 1 19:19:58 2020 +0000

    python: Remove unnecessary comprehension
    
    Co-authored-by: deepsource-autofix[bot] <62...@users.noreply.github.com>
---
 doc/checkvers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/checkvers.py b/doc/checkvers.py
index e16e7e4..cf1f841 100644
--- a/doc/checkvers.py
+++ b/doc/checkvers.py
@@ -29,7 +29,7 @@ if __name__ == '__main__':
     # Check whether we have the required version of sphinx.
     if options.checkvers:
         min_sphinx_version_info = (1,7,5)
-        min_sphinx_version = '.'.join([str(x) for x in min_sphinx_version_info])
+        min_sphinx_version = '.'.join(str(x) for x in min_sphinx_version_info)
 
         print('checking for sphinx version >= {0}... '.format(min_sphinx_version), end="")
         # Need at least 1.5.1 to use svg