Skip to content

Commit

Permalink
Merge pull request #117 from telekom-mms/multiple-fixes
Browse files Browse the repository at this point in the history
Multiple fixes
  • Loading branch information
neubi4 authored Jul 23, 2024
2 parents 7943572 + 33ca782 commit f307248
Show file tree
Hide file tree
Showing 7 changed files with 330 additions and 373 deletions.
Empty file added .github/version-drafter.yml
Empty file.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions fortilib/addressgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ def __init__(self):
def populate(self, object_data: dict):
super().populate(object_data)

def __eq__(self, other):
if isinstance(other, FortigateAddressGroup):
return self.name == other.name and self.member == other.member

return False

def render(self) -> dict:
"""Generate dict with all object arguments for fortigate api call.
Expand Down
4 changes: 3 additions & 1 deletion fortilib/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ def get_interfaces(self) -> List[FortigateInterface]:
"""Query Fortigate API for interfaces
:class:`fortilib.interface.FortigateInterface` and create list.
"""
interfaces: List[FortigateInterface] = [FortigateInterface.from_dict({"name": "any"})]
interfaces: List[FortigateInterface] = [
FortigateInterface.from_dict({"name": "any"})
]
for raw in self.fortigate.get_firewall_interface():
interface = FortigateInterface.from_dict(raw)
interfaces.append(interface)
Expand Down
682 changes: 316 additions & 366 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ keywords = ["firewall", "fortinet", "fortigate"]
Changelog = "https://github.com/telekom-mms/fortilib/blob/master/CHANGELOG.md"

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
python = ">=3.9,<4.0"
httpx = ">=0.23.0"

[tool.poetry.dev-dependencies]
Expand All @@ -32,9 +32,8 @@ coverage = ">=6.4.2"
pytest-integration = ">=0.2.2"
pytest-cov = ">=4.0.0"
pytest-order = ">=1.0.1"
Sphinx = ">=5.1.1"
flake8 = ">=5.0.4"
flake8-gl-codeclimate = ">=0.1.6"
Sphinx = "^7.4.7"
flake8 = "^7.0.0"
sphinx-rtd-theme = ">=1.0.0"

[build-system]
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ commands =
[testenv:linter]
commands =
poetry install -v
flake8 --format gl-codeclimate --output-file gl-code-quality-report.json
flake8

[testenv:formatter]
commands =
Expand Down

0 comments on commit f307248

Please sign in to comment.