Skip to content

Commit

Permalink
⬆️ Upgrade Black due to dependabot warning and minor upgrade of some …
Browse files Browse the repository at this point in the history
…other dependencies
  • Loading branch information
patrikspiess committed Mar 26, 2024
1 parent 88a7759 commit a060aa4
Show file tree
Hide file tree
Showing 76 changed files with 182 additions and 126 deletions.
3 changes: 3 additions & 0 deletions WHATSNEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

### Changed

- Upgrade black to ~24.03.0 due to dependabot warning
- Minor update of several dependencies

### Removed

1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
https://www.sphinx-doc.org/en/master/usage/configuration.html
"""


# -- configure linter ------------------------------------------------------------------------------
# pylint: disable=invalid-name

Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/convert.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The fotoobo convert commands
"""

import logging
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/ems/get_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiClient EMS get commands
"""

import logging

import typer
Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/ems/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiClient EMS commands
"""

import logging

import typer
Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/ems/monitor_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiClient EMS monitor commands
"""

import logging
from pathlib import Path
from typing import Optional, Union
Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/faz/get_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiAnalyzer get commands
"""

import logging

import typer
Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/faz/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiAnalyzer commands
"""

import logging

import typer
Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/fgt/get_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiGate get commands
"""

# pylint: disable=anomalous-backslash-in-string
import logging

Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/fgt/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiGate commands
"""

import logging
import os
from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/fgt/monitor_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiGate check commands
"""

import logging
from pathlib import Path
from typing import Dict, Optional
Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/fmg/get_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiManager get commands
"""

import logging
from pathlib import Path
from typing import Dict, List, Union
Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/fmg/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiManager commands
"""

import logging
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions fotoobo/cli/get.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The fotoobo get commands
"""

import logging

import typer
Expand Down
1 change: 1 addition & 0 deletions fotoobo/exceptions/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This is the fotoobo exception module.
"""

from typing import Any

from requests.exceptions import HTTPError
Expand Down
1 change: 1 addition & 0 deletions fotoobo/fortinet/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
The Fortinet assets are referenced by their names. Even if we set an uuid we cannot use the uuid to
access the asset. The uuid is only supported for network assets and not for service assets.
"""

import copy
import logging
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions fotoobo/fortinet/fortianalyzer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiAnalyzer Class
"""

import logging
from typing import Any

Expand Down
1 change: 1 addition & 0 deletions fotoobo/fortinet/fortigate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiGate Class
"""

import logging
from typing import Any, Dict, Optional

Expand Down
1 change: 1 addition & 0 deletions fotoobo/fortinet/fortigate_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiGate configuration class represents the whole or parts of a FortiGate configuration
"""

import logging
from pathlib import Path
from typing import IO, Any, Dict, List, Optional
Expand Down
1 change: 1 addition & 0 deletions fotoobo/fortinet/fortigate_config_check.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiGate configuration checker
"""

import logging
from typing import Any, Dict, List

Expand Down
1 change: 1 addition & 0 deletions fotoobo/fortinet/fortigate_info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The FortiGateInfo class
"""

from dataclasses import dataclass


Expand Down
1 change: 1 addition & 0 deletions fotoobo/fortinet/fortimanager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiManager Class
"""

import logging
import re
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions fotoobo/helpers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
If there are configuration options available in the global configuration file and also as a command
line option, the command line option takes precedence over the global configuration file option.
"""

import os
from dataclasses import dataclass, field
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions fotoobo/helpers/files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Some helper functions for file manipulation.
"""

import json
import logging
import re
Expand Down
17 changes: 11 additions & 6 deletions fotoobo/helpers/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
to do pretty printing screen output with rich and writing "normal" text to a logfile.
Basic logging options can be configured in the main configuration file. See config_helper.py
"""

import logging
import logging.config
import os
Expand Down Expand Up @@ -219,9 +220,11 @@ def configure_logging(quiet: Optional[bool], log_level: Optional[str]) -> None:
config.logging["log_syslog"]["host"],
int(config.logging["log_syslog"]["port"]),
),
socktype=socket.SOCK_STREAM
if config.logging["log_syslog"]["protocol"] == "TCP"
else socket.SOCK_DGRAM,
socktype=(
socket.SOCK_STREAM
if config.logging["log_syslog"]["protocol"] == "TCP"
else socket.SOCK_DGRAM
),
)

except (OSError, socket.gaierror) as error:
Expand Down Expand Up @@ -256,9 +259,11 @@ def configure_logging(quiet: Optional[bool], log_level: Optional[str]) -> None:
int(config.audit_logging["log_syslog"]["port"]),
),
facility=LOG_AUTH,
socktype=socket.SOCK_STREAM
if config.audit_logging["log_syslog"]["protocol"] == "TCP"
else socket.SOCK_DGRAM,
socktype=(
socket.SOCK_STREAM
if config.audit_logging["log_syslog"]["protocol"] == "TCP"
else socket.SOCK_DGRAM
),
)

except (OSError, socket.gaierror) as error:
Expand Down
1 change: 1 addition & 0 deletions fotoobo/helpers/output.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The beautiful output helper
"""

import os
from datetime import datetime
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions fotoobo/inventory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
init.py
"""

from .generic import GenericDevice
from .inventory import Inventory

Expand Down
1 change: 1 addition & 0 deletions fotoobo/inventory/generic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A module for defining a generic device
"""

from typing import Union


Expand Down
1 change: 1 addition & 0 deletions fotoobo/inventory/inventory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Devices class for storing device information
"""

import logging
import re
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions fotoobo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
The exceptions in the main functions cannot be tested because the test-method for typer always
exits with its own exit codes (1 or 2) when an exception rises.
"""

import sys
import traceback

Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
relevant fotoobo and Fortinet modules. By default the tools functions are invoked by the cli app,
but they may also be accessed directly.
"""

from . import convert, ems, faz, fgt, fmg, get
from .greet import greet

Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/convert.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The fotoobo converter utility
"""

import logging
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/ems/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
ems tools
"""

from fotoobo.tools.ems import get, monitor

__all__ = ["get", "monitor"]
1 change: 1 addition & 0 deletions fotoobo/tools/ems/get.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiClient EMS get module
"""

import logging
from typing import Dict, List

Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/ems/monitor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiClient EMS monitor module
"""

import logging
from datetime import datetime
from typing import Any, Dict
Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/faz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
faz tools
"""

from . import get

__all__ = ["get"]
1 change: 1 addition & 0 deletions fotoobo/tools/faz/get.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiAnalyzer get version utility
"""

import logging

from fotoobo.helpers.config import config
Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/fgt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
fgt tools
"""

from . import config, get, monitor
from .main import backup

Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/fgt/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiGate configuration check utility
"""

import logging
from pathlib import Path
from typing import Any, List
Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/fgt/get.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiGate get version utility
"""

import concurrent.futures
import logging
from typing import Optional, Tuple
Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/fgt/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiGate backup utility
"""

import concurrent.futures
import json
import logging
Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/fgt/monitor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiGate check hamaster utility
"""

import concurrent.futures
import logging
from typing import Dict, Tuple
Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/fmg/get.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiManager get ADOMs utility
"""

import logging
from typing import Any, Dict, List, Optional, Union

Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/fmg/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
FortiManager assign utility
"""

import logging
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/get.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The fotoobo get utility
"""

import importlib.metadata
import logging
from typing import Dict, List
Expand Down
1 change: 1 addition & 0 deletions fotoobo/tools/greet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This function is a hidden fotoobo command which is meant for testing purposes. It has no functional
effect. Use and modify it whenever you want. But be sure to also write the tests for it.
"""

import logging

import typer
Expand Down
Loading

0 comments on commit a060aa4

Please sign in to comment.