Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
chore: Sort all Python source files with isort
Browse files Browse the repository at this point in the history
Changelog: None
  • Loading branch information
Ole Petter committed Mar 8, 2021
1 parent aa90340 commit a4762bd
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 35 deletions.
3 changes: 2 additions & 1 deletion src/mender/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
import os.path
from typing import Optional

from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKeyWithSerialization
from cryptography.exceptions import UnsupportedAlgorithm
from cryptography.hazmat.primitives.asymmetric.rsa import \
RSAPrivateKeyWithSerialization

import mender.security.key as key

Expand Down
5 changes: 3 additions & 2 deletions src/mender/client/authorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import json
import logging as log
from typing import Optional
import requests

from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKeyWithSerialization
import requests
from cryptography.hazmat.primitives.asymmetric.rsa import \
RSAPrivateKeyWithSerialization

import mender.security.key as key

Expand Down
7 changes: 3 additions & 4 deletions src/mender/client/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging as log
from typing import Optional
from typing import Dict
import os.path
import time
import re
import time
from typing import Dict, Optional

import requests

import mender.settings.settings as settings
import mender.log.log as menderlog
import mender.settings.settings as settings
from mender.client import HTTPUnathorized

STATUS_SUCCESS = "success"
Expand Down
1 change: 1 addition & 0 deletions src/mender/client/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
import json
import logging as log

import requests


Expand Down
1 change: 0 additions & 1 deletion src/mender/mender.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import mender.client.deployments as deployments
import mender.settings.settings as settings
import mender.statemachine.statemachine as statemachine

from mender._version import __version__ as package_version
from mender.log.log import DeploymentLogHandler

Expand Down
1 change: 0 additions & 1 deletion src/mender/scripts/aggregator/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.
import logging as log
import subprocess

from typing import Dict, List


Expand Down
2 changes: 1 addition & 1 deletion src/mender/scripts/aggregator/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import logging as log
import os

from mender.scripts.aggregator.aggregator import ScriptKeyValueAggregator

Expand Down
2 changes: 1 addition & 1 deletion src/mender/scripts/aggregator/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import os.path as path
from typing import List

from mender.scripts.aggregator.aggregator import ScriptKeyValueAggregator
import mender.scripts.artifactinfo as artifactinfo
import mender.scripts.devicetype as devicetype
from mender.scripts.aggregator.aggregator import ScriptKeyValueAggregator


def aggregate(script_path: str, device_type_path: str, artifact_info_path: str) -> dict:
Expand Down
3 changes: 2 additions & 1 deletion src/mender/security/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# limitations under the License.
import logging as log

from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKeyWithSerialization
from cryptography.hazmat.primitives.asymmetric.rsa import \
RSAPrivateKeyWithSerialization

import mender.security.rsa as rsa

Expand Down
10 changes: 4 additions & 6 deletions src/mender/security/rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
import os

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives.asymmetric import rsa

from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKeyWithSerialization
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import padding, rsa
from cryptography.hazmat.primitives.asymmetric.rsa import \
RSAPrivateKeyWithSerialization

RSA_KEY_LENGTH = 3072

Expand Down
1 change: 0 additions & 1 deletion src/mender/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.
import os.path


SLEEP_INTERVAL = 60


Expand Down
3 changes: 1 addition & 2 deletions src/mender/util/timeutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from datetime import timedelta
from datetime import datetime
import time
import typing
from datetime import datetime, timedelta


class IsItTime:
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_authorized.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
# limitations under the License.

import logging as log

import pytest

import mender.security.key as key
import mender.client.authorize as authorize
import mender.security.key as key


@pytest.fixture(name="server_url")
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import json
import logging as log
import os

import pytest

import mender.config.config as config

GLOBAL_TESTDATA = {
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/test_deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import hashlib

import requests
import os

import pytest
import requests
from werkzeug.wrappers import Response

import mender.client.deployments as deployments
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import logging as log

import pytest

import mender.client.inventory as inventory
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import json
import logging as testlogger
import os.path

import pytest

import mender.log.log as mlog
Expand Down
4 changes: 1 addition & 3 deletions tests/unit/test_mender.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@

import pytest

import mender.mender as main

import mender.bootstrap.bootstrap as bootstrap
import mender.client.authorize as authorize
import mender.client.deployments as deployments
import mender.mender as main
import mender.settings.settings as settings
import mender.statemachine.statemachine as statemachine

from mender.log.log import DeploymentLogHandler


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_script_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import logging as log
import os
import stat

import pytest
Expand Down
8 changes: 3 additions & 5 deletions tests/unit/test_statemachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import pytest

from mender.client import HTTPUnathorized
from mender.util import timeutil
import mender.client.deployments as deployments
import mender.client.inventory as client_inventory
import mender.config.config as config
Expand All @@ -30,10 +28,10 @@
import mender.scripts.devicetype as devicetype
import mender.scripts.runner as installscriptrunner
import mender.settings.settings as settings

from mender.log.log import DeploymentLogHandler

import mender.statemachine.statemachine as statemachine
from mender.client import HTTPUnathorized
from mender.log.log import DeploymentLogHandler
from mender.util import timeutil


@pytest.fixture(name="ctx")
Expand Down

0 comments on commit a4762bd

Please sign in to comment.