From 9a0fbc7098a0b1123f56a6d27248809617bc77aa Mon Sep 17 00:00:00 2001 From: checktheroads Date: Mon, 13 Apr 2020 01:00:42 -0700 Subject: [PATCH] Update dependencies; bump version --- .flake8 | 1 + hyperglass/constants.py | 2 +- hyperglass/examples/commands.yaml | 125 ---------------------------- hyperglass/examples/hyperglass.yaml | 2 +- install.sh | 2 +- poetry.lock | 23 ++++- pyproject.toml | 3 +- validate_examples.py | 8 +- 8 files changed, 33 insertions(+), 133 deletions(-) diff --git a/.flake8 b/.flake8 index c629b2b..34b4bd7 100644 --- a/.flake8 +++ b/.flake8 @@ -6,6 +6,7 @@ statistics=True exclude=.git, __pycache__, hyperglass/api/examples/*.py, hyperglass/compat/_sshtunnel.py, hyperglass/test.py filename=*.py per-file-ignores= + hyperglass/main.py:E402 # Disable redefinition warning for exception handlers hyperglass/api.py:F811 # Disable classmethod warning for validator decorators diff --git a/hyperglass/constants.py b/hyperglass/constants.py index 7b74b37..4c5a0d9 100644 --- a/hyperglass/constants.py +++ b/hyperglass/constants.py @@ -4,7 +4,7 @@ import sys from datetime import datetime __name__ = "hyperglass" -__version__ = "1.0.0-beta.18" +__version__ = "1.0.0-beta.19" __author__ = "Matt Love" __copyright__ = f"Copyright {datetime.now().year} Matthew Love" __license__ = "BSD 3-Clause Clear License" diff --git a/hyperglass/examples/commands.yaml b/hyperglass/examples/commands.yaml index 3145145..e69de29 100644 --- a/hyperglass/examples/commands.yaml +++ b/hyperglass/examples/commands.yaml @@ -1,125 +0,0 @@ -# arista: -# ipv4_default: -# bgp_aspath: show ip bgp regexp {target} -# bgp_community: show ip bgp community {target} -# bgp_route: show ip bgp {target} -# ping: ping ip {target} source {source} -# traceroute: traceroute ip {target} source {source} -# ipv4_vpn: -# bgp_aspath: show ip bgp regexp {target} vrf {vrf} -# bgp_community: show ip bgp community {target} vrf {vrf} -# bgp_route: show ip bgp {target} vrf {vrf} -# ping: ping vrf {vrf} ip {target} source {source} -# traceroute: traceroute vrf {vrf} ip {target} source {source} -# ipv6_default: -# bgp_aspath: show ipv6 bgp regexp {target} -# bgp_community: show ipv6 bgp community {target} -# bgp_route: show ipv6 bgp {target} -# ping: ping ipv6 {target} source {source} -# traceroute: traceroute ipv6 {target} source {source} -# ipv6_vpn: -# bgp_aspath: show ipv6 bgp regexp {target} vrf {vrf} -# bgp_community: show ipv6 bgp community {target} vrf {vrf} -# bgp_route: show ipv6 bgp {target} vrf {vrf} -# ping: ping vrf {vrf} ipv6 {target} source {source} -# traceroute: traceroute vrf {vrf} ipv6 {target} source {source} -# cisco_ios: -# ipv4_default: -# bgp_aspath: show bgp ipv4 unicast quote-regexp "{target}" -# bgp_community: show bgp ipv4 unicast community {target} -# bgp_route: show bgp ipv4 unicast {target} | exclude pathid:|Epoch -# ping: ping {target} repeat 5 source {source} -# traceroute: traceroute {target} timeout 1 probe 2 source {source} -# ipv4_vpn: -# bgp_aspath: show bgp vpnv4 unicast vrf {vrf} quote-regexp "{target}" -# bgp_community: show bgp vpnv4 unicast vrf {vrf} community {target} -# bgp_route: show bgp vpnv4 unicast vrf {vrf} {target} -# ping: ping vrf {vrf} {target} repeat 5 source {source} -# traceroute: traceroute vrf {vrf} {target} timeout 1 probe 2 source {source} -# ipv6_default: -# bgp_aspath: show bgp ipv6 unicast quote-regexp "{target}" -# bgp_community: show bgp ipv6 unicast community {target} -# bgp_route: show bgp ipv6 unicast {target} | exclude pathid:|Epoch -# ping: ping ipv6 {target} repeat 5 source {source} -# traceroute: traceroute ipv6 {target} timeout 1 probe 2 source {source} -# ipv6_vpn: -# bgp_aspath: show bgp vpnv6 unicast vrf {vrf} quote-regexp "{target}" -# bgp_community: show bgp vpnv6 unicast vrf {vrf} community {target} -# bgp_route: show bgp vpnv6 unicast vrf {vrf} {target} -# ping: ping vrf {vrf} {target} repeat 5 source {source} -# traceroute: traceroute vrf {vrf} {target} timeout 1 probe 2 source {source} -# cisco_xr: -# ipv4_default: -# bgp_aspath: show bgp ipv4 unicast regexp {target} -# bgp_community: show bgp ipv4 unicast community {target} -# bgp_route: show bgp ipv4 unicast {target} -# ping: ping ipv4 {target} count 5 source {source} -# traceroute: traceroute ipv4 {target} timeout 1 probe 2 source {source} -# ipv4_vpn: -# bgp_aspath: show bgp vpnv4 unicast vrf {vrf} regexp {target} -# bgp_community: show bgp vpnv4 unicast vrf {vrf} community {target} -# bgp_route: show bgp vpnv4 unicast vrf {vrf} {target} -# ping: ping vrf {vrf} {target} count 5 source {source} -# traceroute: traceroute vrf {vrf} {target} timeout 1 probe 2 source {source} -# ipv6_default: -# bgp_aspath: show bgp ipv6 unicast regexp {target} -# bgp_community: show bgp ipv6 unicast community {target} -# bgp_route: show bgp ipv6 unicast {target} -# ping: ping ipv6 {target} count 5 source {source} -# traceroute: traceroute ipv6 {target} timeout 1 probe 2 source {source} -# ipv6_vpn: -# bgp_aspath: show bgp vpnv6 unicast vrf {vrf} regexp {target} -# bgp_community: show bgp vpnv6 unicast vrf {vrf} community {target} -# bgp_route: show bgp vpnv6 unicast vrf {vrf} {target} -# ping: ping vrf {vrf} {target} count 5 source {source} -# traceroute: traceroute vrf {vrf} {target} timeout 1 probe 2 source {source} -# huawei: -# ipv4_default: -# bgp_aspath: display bgp routing-table regular-expression {target} -# bgp_community: display bgp routing-table regular-expression {target} -# bgp_route: display bgp routing-table {target} -# ping: ping -c 5 -a {source} {target} -# traceroute: tracert -q 2 -f 1 -a {source} {target} -# ipv4_vpn: -# bgp_aspath: display bgp vpnv4 vpn-instance {vrf} routing-table regular-expression {target} -# bgp_community: display bgp vpnv4 vpn-instance {vrf} routing-table regular-expression {target} -# bgp_route: display bgp vpnv4 vpn-instance {vrf} routing-table {target} -# ping: ping -vpn-instance {vrf} -c 5 -a {source} {target} -# traceroute: tracert -q 2 -f 1 -vpn-instance {vrf} -a {source} {target} -# ipv6_default: -# bgp_aspath: display bgp ipv6 routing-table regular-expression {target} -# bgp_community: display bgp ipv6 routing-table community {target} -# bgp_route: display bgp ipv6 routing-table {target} -# ping: ping ipv6 -c 5 -a {source} {target} -# traceroute: tracert ipv6 -q 2 -f 1 -a {source} {target} -# ipv6_vpn: -# bgp_aspath: display bgp vpnv6 vpn-instance {vrf} routing-table regular-expression {target} -# bgp_community: display bgp vpnv6 vpn-instance {vrf} routing-table regular-expression {target} -# bgp_route: display bgp vpnv6 vpn-instance {vrf} routing-table {target} -# ping: ping vpnv6 vpn-instance {vrf} -c 5 -a {source} {target} -# traceroute: tracert -q 2 -f 1 vpn-instance {vrf} -a {source} {target} -# juniper: -# ipv4_default: -# bgp_aspath: show route protocol bgp table inet.0 aspath-regex "{target}" -# bgp_community: show route protocol bgp table inet.0 community {target} -# bgp_route: show route protocol bgp table inet.0 {target} detail | except Label | except Label | except "Next hop type" | except Task | except Address | except "Session Id" | except State | except "Next-hop reference" | except destinations | except "Announcement bits" -# ping: ping inet {target} count 5 source {source} -# traceroute: traceroute inet {target} wait 1 source {source} -# ipv4_vpn: -# bgp_aspath: show route protocol bgp table {vrf}.inet.0 aspath-regex "{target}" -# bgp_community: show route protocol bgp table {vrf}.inet.0 community {target} -# bgp_route: show route protocol bgp table {vrf}.inet.0 {target} detail | except Label | except Label | except "Next hop type" | except Task | except Address | except "Session Id" | except State | except "Next-hop reference" | except destinations | except "Announcement bits" -# ping: ping inet routing-instance {vrf} {target} count 5 source {source} -# traceroute: traceroute inet routing-instance {vrf} {target} wait 1 source {source} -# ipv6_default: -# bgp_aspath: show route protocol bgp table inet6.0 aspath-regex "{target}" -# bgp_community: show route protocol bgp table inet6.0 community {target} -# bgp_route: show route protocol bgp table inet6.0 {target} detail | except Label | except Label | except "Next hop type" | except Task | except Address | except "Session Id" | except State | except "Next-hop reference" | except destinations | except "Announcement bits" -# ping: ping inet6 {target} count 5 source {source} -# traceroute: traceroute inet6 {target} wait 2 source {source} -# ipv6_vpn: -# bgp_aspath: show route protocol bgp table {vrf}.inet6.0 aspath-regex "{target}" -# bgp_community: show route protocol bgp table {vrf}.inet6.0 community {target} -# bgp_route: show route protocol bgp table {vrf}.inet6.0 {target} detail | except Label | except Label | except "Next hop type" | except Task | except Address | except "Session Id" | except State | except "Next-hop reference" | except destinations | except "Announcement bits" -# ping: ping inet6 routing-instance {vrf} {target} count 5 source {source} -# traceroute: traceroute inet6 routing-instance {vrf} {target} wait 2 source {source} diff --git a/hyperglass/examples/hyperglass.yaml b/hyperglass/examples/hyperglass.yaml index d822453..6703fce 100644 --- a/hyperglass/examples/hyperglass.yaml +++ b/hyperglass/examples/hyperglass.yaml @@ -1,5 +1,5 @@ # cache: -# database: 0 +# database: 1 # host: localhost # port: 6379 # show_text: true diff --git a/install.sh b/install.sh index 25b9d03..0b23b1a 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ set -e -HYPERGLASS_VERSION="1.0.0b18" +HYPERGLASS_VERSION="1.0.0b19" MIN_PYTHON_MAJOR="3" MIN_PYTHON_MINOR="6" diff --git a/poetry.lock b/poetry.lock index 7e965cb..3267325 100644 --- a/poetry.lock +++ b/poetry.lock @@ -519,6 +519,23 @@ version = "3.1.0" [package.dependencies] gitdb = ">=4.0.1,<5" +[[package]] +category = "main" +description = "WSGI HTTP Server for UNIX" +name = "gunicorn" +optional = false +python-versions = ">=3.4" +version = "20.0.4" + +[package.dependencies] +setuptools = ">=3.0" + +[package.extras] +eventlet = ["eventlet (>=0.9.7)"] +gevent = ["gevent (>=0.13)"] +setproctitle = ["setproctitle"] +tornado = ["tornado (>=0.2)"] + [[package]] category = "main" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" @@ -1156,7 +1173,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] testing = ["jaraco.itertools", "func-timeout"] [metadata] -content-hash = "50471d63d1824744cda9366ebfa22e8c6dbd276a5ff0ff7955e6ecf7b3791936" +content-hash = "7a4bbf22965a2af2a61fcc9d67126093e54986f11e9514d828db6e156534b865" python-versions = "^3.6" [metadata.files] @@ -1399,6 +1416,10 @@ gitpython = [ {file = "GitPython-3.1.0-py3-none-any.whl", hash = "sha256:43da89427bdf18bf07f1164c6d415750693b4d50e28fc9b68de706245147b9dd"}, {file = "GitPython-3.1.0.tar.gz", hash = "sha256:e426c3b587bd58c482f0b7fe6145ff4ac7ae6c82673fc656f489719abca6f4cb"}, ] +gunicorn = [ + {file = "gunicorn-20.0.4-py2.py3-none-any.whl", hash = "sha256:cd4a810dd51bf497552cf3f863b575dabd73d6ad6a91075b65936b151cbf4f9c"}, + {file = "gunicorn-20.0.4.tar.gz", hash = "sha256:1904bb2b8a43658807108d59c3f3d56c2b6121a701161de0ddf9ad140073c626"}, +] h11 = [ {file = "h11-0.9.0-py2.py3-none-any.whl", hash = "sha256:4bc6d6a1238b7615b266ada57e0618568066f57dd6fa967d1290ec9309b2f2f1"}, {file = "h11-0.9.0.tar.gz", hash = "sha256:33d4bca7be0fa039f4e84d50ab00531047e53d6ee8ffbc83501ea602c169cae1"}, diff --git a/pyproject.toml b/pyproject.toml index 66d24cc..e04f152 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api" [tool.poetry] name = "hyperglass" -version = "1.0.0-beta.18" +version = "1.0.0-beta.19" description = "hyperglass is the modern network looking glass that tries to make the internet better." authors = ["Matt Love "] readme = "README.md" @@ -33,6 +33,7 @@ uvicorn = "^0.11" uvloop = "^0.14.0" inquirer = "^2.6.3" paramiko = "^2.7.1" +gunicorn = "^20.0.4" [tool.poetry.dev-dependencies] bandit = "^1.6.2" diff --git a/validate_examples.py b/validate_examples.py index 58b095c..2f2779b 100644 --- a/validate_examples.py +++ b/validate_examples.py @@ -26,8 +26,10 @@ def _uncomment_files(): output = [] with file.open("r") as f: for line in f.readlines(): - if re.match(r"^(#\s+[a-z0-9]+)|(#\s+\-\s.*$)", line): - output.append(re.sub(r"^(#\s)", "", line)) + # if re.match(r"^(#\s+[a-z0-9]+)|(#\s+\-\s.*$)|(#\s#\s.*$)", line): + commented = re.compile(r"^(#\s*#?\s?).*$") + if re.match(commented, line): + output.append(re.sub(r"^#\s*#?\s?$", "", line)) else: output.append(line) with file.open("w") as f: @@ -41,7 +43,7 @@ def _comment_optional_files(): output = [] with file.open("r") as f: for line in f.readlines(): - if not re.match(r"^(#\s+[A-Za-z0-9])|(^\-{3})", line): + if not re.match(r"^(#\s*#?\s?).*$|(^\-{3})", line): output.append("# " + line) else: output.append(line)