nginx-lens 0.2.2__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of nginx-lens might be problematic. Click here for more details.

Files changed (48) hide show
  1. {nginx_lens-0.2.2/nginx_lens.egg-info → nginx_lens-0.2.3}/PKG-INFO +1 -1
  2. {nginx_lens-0.2.2 → nginx_lens-0.2.3/nginx_lens.egg-info}/PKG-INFO +1 -1
  3. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/setup.py +1 -1
  4. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/upstream_checker/checker.py +22 -5
  5. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/LICENSE +0 -0
  6. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/README.md +0 -0
  7. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/__init__.py +0 -0
  8. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/base.py +0 -0
  9. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/conflicts.py +0 -0
  10. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/dead_locations.py +0 -0
  11. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/diff.py +0 -0
  12. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/duplicates.py +0 -0
  13. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/empty_blocks.py +0 -0
  14. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/include.py +0 -0
  15. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/rewrite.py +0 -0
  16. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/route.py +0 -0
  17. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/unused.py +0 -0
  18. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/analyzer/warnings.py +0 -0
  19. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/__init__.py +0 -0
  20. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/analyze.py +0 -0
  21. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/cli.py +0 -0
  22. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/diff.py +0 -0
  23. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/graph.py +0 -0
  24. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/health.py +0 -0
  25. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/include.py +0 -0
  26. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/logs.py +0 -0
  27. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/route.py +0 -0
  28. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/syntax.py +0 -0
  29. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/commands/tree.py +0 -0
  30. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/exporter/__init__.py +0 -0
  31. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/exporter/graph.py +0 -0
  32. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/exporter/html.py +0 -0
  33. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/exporter/markdown.py +0 -0
  34. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/nginx_lens.egg-info/SOURCES.txt +0 -0
  35. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/nginx_lens.egg-info/dependency_links.txt +0 -0
  36. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/nginx_lens.egg-info/entry_points.txt +0 -0
  37. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/nginx_lens.egg-info/requires.txt +0 -0
  38. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/nginx_lens.egg-info/top_level.txt +0 -0
  39. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/parser/__init__.py +0 -0
  40. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/parser/nginx_parser.py +0 -0
  41. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/pyproject.toml +0 -0
  42. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/setup.cfg +0 -0
  43. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/tests/test_conflicts.py +0 -0
  44. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/tests/test_duplicates.py +0 -0
  45. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/tests/test_empty_blocks.py +0 -0
  46. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/tests/test_health.py +0 -0
  47. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/tests/test_parser.py +0 -0
  48. {nginx_lens-0.2.2 → nginx_lens-0.2.3}/upstream_checker/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nginx-lens
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: CLI-инструмент для анализа, визуализации и диагностики конфигураций Nginx
5
5
  Author: Daniil Astrouski
6
6
  Author-email: shelovesuastra@gmail.com
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nginx-lens
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: CLI-инструмент для анализа, визуализации и диагностики конфигураций Nginx
5
5
  Author: Daniil Astrouski
6
6
  Author-email: shelovesuastra@gmail.com
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="nginx-lens",
5
- version="0.2.2",
5
+ version="0.2.3",
6
6
  description="CLI-инструмент для анализа, визуализации и диагностики конфигураций Nginx",
7
7
  author="Daniil Astrouski",
8
8
  author_email="shelovesuastra@gmail.com",
@@ -7,9 +7,15 @@ from typing import Dict, List
7
7
 
8
8
 
9
9
  def check_tcp(address: str, timeout: float, retries: int) -> bool:
10
- """Проверка доступности сервера по TCP"""
11
- host, port = address.split(":")
10
+ """
11
+ Проверка доступности сервера по TCP.
12
+ Ignores extra upstream options like 'max_fails' or 'fail_timeout'.
13
+ """
14
+ # Берем только host:port, игнорируем параметры
15
+ host_port = address.split()[0]
16
+ host, port = host_port.split(":")
12
17
  port = int(port)
18
+
13
19
  for _ in range(retries):
14
20
  try:
15
21
  with socket.create_connection((host, port), timeout=timeout):
@@ -20,9 +26,14 @@ def check_tcp(address: str, timeout: float, retries: int) -> bool:
20
26
 
21
27
 
22
28
  def check_http(address: str, timeout: float, retries: int) -> bool:
23
- """Проверка доступности сервера по HTTP (GET /)"""
24
- host, port = address.split(":")
29
+ """
30
+ Проверка доступности сервера по HTTP (GET /).
31
+ Ignores extra upstream options like 'max_fails' or 'fail_timeout'.
32
+ """
33
+ host_port = address.split()[0]
34
+ host, port = host_port.split(":")
25
35
  port = int(port)
36
+
26
37
  for _ in range(retries):
27
38
  try:
28
39
  conn = http.client.HTTPConnection(host, port, timeout=timeout)
@@ -38,10 +49,16 @@ def check_http(address: str, timeout: float, retries: int) -> bool:
38
49
  return False
39
50
 
40
51
 
41
- def check_upstreams(upstreams: Dict[str, List[str]], timeout=2.0, retries=1, mode="tcp") -> Dict[str, List[dict]]:
52
+ def check_upstreams(
53
+ upstreams: Dict[str, List[str]],
54
+ timeout: float = 2.0,
55
+ retries: int = 1,
56
+ mode: str = "tcp"
57
+ ) -> Dict[str, List[dict]]:
42
58
  """
43
59
  Проверяет доступность upstream-серверов.
44
60
  mode: "tcp" (по умолчанию) или "http"
61
+
45
62
  Возвращает:
46
63
  {
47
64
  "backend": [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes