Skip to content

Commit 9a0f7f0

Browse files
committed
Refactor update assignment
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 603bb35 commit 9a0f7f0

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/cryptojwt/key_bundle.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -481,13 +481,18 @@ def update(self):
481481
self._keys = []
482482

483483
try:
484-
if self.local:
485-
if self.fileformat in ["jwks", "jwk"]:
486-
updated = self.do_local_jwk(self.source)
487-
elif self.fileformat == "der":
488-
updated = self.do_local_der(self.source, self.keytype, self.keyusage)
489-
elif self.remote:
490-
updated = self.do_remote()
484+
updated = (
485+
self.do_remote()
486+
if self.remote
487+
488+
else self.do_local_jwk(self.source)
489+
if self.local and self.fileformat in ["jwks", "jwk"]
490+
491+
else self.do_local_der(self.source, self.keytype, self.keyusage)
492+
if self.local and self.fileformat in ["der"]
493+
494+
else False
495+
)
491496
except Exception as err:
492497
LOGGER.error("Key bundle update failed: %s", err)
493498
self._keys = _old_keys # restore

0 commit comments

Comments
 (0)