Fix lint issues

This commit is contained in:
Pedro Algarvio 2024-03-07 21:53:18 +00:00
parent 74415c7d0a
commit 04a992a47c
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF
3 changed files with 12 additions and 12 deletions

View file

@ -108,9 +108,9 @@ def present(
if not text and skip_keyserver and not source: if not text and skip_keyserver and not source:
ret["result"] = False ret["result"] = False
ret[ ret["comment"] = (
"comment" "When skipping keyservers, you must provide at least one source"
] = "When skipping keyservers, you must provide at least one source" )
return ret return ret
_current_keys = __salt__["gpg.list_keys"]( _current_keys = __salt__["gpg.list_keys"](
@ -187,7 +187,7 @@ def present(
text=text, keyid=key, gnupghome=gnupghome, user=user text=text, keyid=key, gnupghome=gnupghome, user=user
) )
if has_key: if has_key:
log.debug(f"Passed text contains key {key}") log.debug("Passed text contains key %s", key)
result = __salt__["gpg.import_key"]( result = __salt__["gpg.import_key"](
text=text, text=text,
user=user, user=user,
@ -215,12 +215,12 @@ def present(
for src in source: for src in source:
sfn = __salt__["cp.cache_file"](src) sfn = __salt__["cp.cache_file"](src)
if sfn: if sfn:
log.debug(f"Found source: {src}") log.debug("Found source: %s", src)
has_key = __salt__["gpg.read_key"]( has_key = __salt__["gpg.read_key"](
path=sfn, keyid=key, gnupghome=gnupghome, user=user path=sfn, keyid=key, gnupghome=gnupghome, user=user
) )
if has_key: if has_key:
log.debug(f"Found source {src} contains key {key}") log.debug("Found source %s contains key %s", src, key)
result = __salt__["gpg.import_key"]( result = __salt__["gpg.import_key"](
filename=sfn, filename=sfn,
user=user, user=user,

View file

@ -95,7 +95,7 @@ def test_when_mongodb_database_remove_is_called_it_should_correctly_pass_ssl_arg
ssl=expected_ssl, ssl=expected_ssl,
tlsAllowInvalidCertificates=expected_allow_invalid, tlsAllowInvalidCertificates=expected_allow_invalid,
), ),
call().__bool__(), call().__bool__(), # pylint: disable=unnecessary-dunder-call
# Not sure why database_names is in the call list given our # Not sure why database_names is in the call list given our
# return_value modifications above - it *should* have removed that # return_value modifications above - it *should* have removed that
# from the mock call list, but it didn't. There's probably some # from the mock call list, but it didn't. There's probably some
@ -111,7 +111,7 @@ def test_when_mongodb_database_remove_is_called_it_should_correctly_pass_ssl_arg
ssl=expected_ssl, ssl=expected_ssl,
tlsAllowInvalidCertificates=expected_allow_invalid, tlsAllowInvalidCertificates=expected_allow_invalid,
), ),
call().__bool__(), call().__bool__(), # pylint: disable=unnecessary-dunder-call
call().drop_database("some_database"), call().drop_database("some_database"),
] ]
) )

View file

@ -137,7 +137,7 @@ def test_when_absent_is_called_it_should_pass_the_correct_ssl_argument_to_MongoC
ssl=expected_ssl, ssl=expected_ssl,
tlsAllowInvalidCertificates=expected_allow_invalid, tlsAllowInvalidCertificates=expected_allow_invalid,
), ),
call().__bool__(), call().__bool__(), # pylint: disable=unnecessary-dunder-call
call( call(
host="example.com", host="example.com",
port=42, port=42,
@ -147,7 +147,7 @@ def test_when_absent_is_called_it_should_pass_the_correct_ssl_argument_to_MongoC
ssl=expected_ssl, ssl=expected_ssl,
tlsAllowInvalidCertificates=expected_allow_invalid, tlsAllowInvalidCertificates=expected_allow_invalid,
), ),
call().__bool__(), call().__bool__(), # pylint: disable=unnecessary-dunder-call
] ]
) )
@ -191,7 +191,7 @@ def test_when_present_is_called_it_should_pass_the_correct_ssl_argument_to_Mongo
ssl=expected_ssl, ssl=expected_ssl,
tlsAllowInvalidCertificates=expected_allow_invalid, tlsAllowInvalidCertificates=expected_allow_invalid,
), ),
call().__bool__(), call().__bool__(), # pylint: disable=unnecessary-dunder-call
call( call(
host="example.com", host="example.com",
port=42, port=42,
@ -201,6 +201,6 @@ def test_when_present_is_called_it_should_pass_the_correct_ssl_argument_to_Mongo
ssl=expected_ssl, ssl=expected_ssl,
tlsAllowInvalidCertificates=expected_allow_invalid, tlsAllowInvalidCertificates=expected_allow_invalid,
), ),
call().__bool__(), call().__bool__(), # pylint: disable=unnecessary-dunder-call
] ]
) )