From a7cf9bb96ab73f60267a3317b2106dd916b64d46 Mon Sep 17 00:00:00 2001 From: Scott Poore Date: Fri, 26 Jan 2024 12:00:30 -0600 Subject: [PATCH] init, ldap, and tests reformatting for black Fixing some spacing and line length issues caught by tox running black. --- sssd_test_framework/hosts/__init__.py | 1 + sssd_test_framework/misc/__init__.py | 1 + sssd_test_framework/roles/__init__.py | 1 + sssd_test_framework/roles/ldap.py | 57 ++++++++++++++------------- sssd_test_framework/utils/__init__.py | 1 + tests/test_misc.py | 1 + 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/sssd_test_framework/hosts/__init__.py b/sssd_test_framework/hosts/__init__.py index 604243c..ae61eb8 100644 --- a/sssd_test_framework/hosts/__init__.py +++ b/sssd_test_framework/hosts/__init__.py @@ -1,2 +1,3 @@ """SSSD multihost hosts.""" + from __future__ import annotations diff --git a/sssd_test_framework/misc/__init__.py b/sssd_test_framework/misc/__init__.py index 506101b..45ed291 100644 --- a/sssd_test_framework/misc/__init__.py +++ b/sssd_test_framework/misc/__init__.py @@ -1,4 +1,5 @@ """Miscellaneous functions.""" + from __future__ import annotations import itertools diff --git a/sssd_test_framework/roles/__init__.py b/sssd_test_framework/roles/__init__.py index 11d2ef5..881cbf1 100644 --- a/sssd_test_framework/roles/__init__.py +++ b/sssd_test_framework/roles/__init__.py @@ -1,2 +1,3 @@ """SSSD multihost roles.""" + from __future__ import annotations diff --git a/sssd_test_framework/roles/ldap.py b/sssd_test_framework/roles/ldap.py index fdaa41f..32267bc 100644 --- a/sssd_test_framework/roles/ldap.py +++ b/sssd_test_framework/roles/ldap.py @@ -1200,12 +1200,9 @@ def add( host: str | list[str] | None = None, command: str | list[str] | None = None, option: str | list[str] | None = None, - runasuser: int - | str - | LDAPUserType - | LDAPGroupType - | list[int | str | LDAPUserType | LDAPGroupType] - | None = None, + runasuser: ( + int | str | LDAPUserType | LDAPGroupType | list[int | str | LDAPUserType | LDAPGroupType] | None + ) = None, runasgroup: int | str | LDAPGroupType | list[int | str | LDAPGroupType] | None = None, notbefore: str | list[str] | None = None, notafter: str | list[str] | None = None, @@ -1264,23 +1261,27 @@ def add( def modify( self, *, - user: int - | str - | LDAPUserType - | LDAPGroupType - | list[int | str | LDAPUserType | LDAPGroupType] - | DeleteAttribute - | None = None, + user: ( + int + | str + | LDAPUserType + | LDAPGroupType + | list[int | str | LDAPUserType | LDAPGroupType] + | DeleteAttribute + | None + ) = None, host: str | list[str] | DeleteAttribute | None = None, command: str | list[str] | DeleteAttribute | None = None, option: str | list[str] | DeleteAttribute | None = None, - runasuser: int - | str - | LDAPUserType - | LDAPGroupType - | list[int | str | LDAPUserType | LDAPGroupType] - | DeleteAttribute - | None = None, + runasuser: ( + int + | str + | LDAPUserType + | LDAPGroupType + | list[int | str | LDAPUserType | LDAPGroupType] + | DeleteAttribute + | None + ) = None, runasgroup: int | str | LDAPGroupType | list[int | str | LDAPGroupType] | DeleteAttribute | None = None, notbefore: str | list[str] | DeleteAttribute | None = None, notafter: str | list[str] | DeleteAttribute | None = None, @@ -1341,13 +1342,15 @@ def modify( def __sudo_user( self, - sudo_user: None - | DeleteAttribute - | int - | str - | LDAPUserType - | LDAPGroupType - | list[int | str | LDAPUserType | LDAPGroupType], + sudo_user: ( + None + | DeleteAttribute + | int + | str + | LDAPUserType + | LDAPGroupType + | list[int | str | LDAPUserType | LDAPGroupType] + ), ) -> list[str] | DeleteAttribute | None: def _get_value(value: int | str | LDAPUserType | LDAPGroupType): if isinstance(value, self.user_cls): diff --git a/sssd_test_framework/utils/__init__.py b/sssd_test_framework/utils/__init__.py index 9c52fff..4bea981 100644 --- a/sssd_test_framework/utils/__init__.py +++ b/sssd_test_framework/utils/__init__.py @@ -1,2 +1,3 @@ """SSSD multihost utils used by roles.""" + from __future__ import annotations diff --git a/tests/test_misc.py b/tests/test_misc.py index f0e790b..09e3023 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1,4 +1,5 @@ """Miscellaneous functions.""" + from __future__ import annotations import textwrap