mirror of
https://github.com/certbot/certbot.git
synced 2026-01-26 07:41:33 +03:00
fix lint
This commit is contained in:
@@ -17,7 +17,7 @@ Certbot adheres to [Semantic Versioning](https://semver.org/).
|
||||
|
||||
### Fixed
|
||||
|
||||
*
|
||||
* Fixed a crash when registering an account with BuyPass' ACME server.
|
||||
|
||||
More details about these changes can be found on our GitHub repo.
|
||||
|
||||
|
||||
@@ -242,11 +242,11 @@ class AccountFileStorage(interfaces.AccountStorage):
|
||||
dir_path = self._prepare(account)
|
||||
self._create(account, dir_path)
|
||||
self._update_meta(account, dir_path)
|
||||
self._update_regr(account, client, dir_path)
|
||||
self._update_regr(account, dir_path)
|
||||
except IOError as error:
|
||||
raise errors.AccountStorageError(error)
|
||||
|
||||
def update_regr(self, account: Account, client: ClientV2) -> None:
|
||||
def update_regr(self, account: Account) -> None:
|
||||
"""Update the registration resource.
|
||||
|
||||
:param Account account: account to update
|
||||
@@ -255,7 +255,7 @@ class AccountFileStorage(interfaces.AccountStorage):
|
||||
"""
|
||||
try:
|
||||
dir_path = self._prepare(account)
|
||||
self._update_regr(account, client, dir_path)
|
||||
self._update_regr(account, dir_path)
|
||||
except IOError as error:
|
||||
raise errors.AccountStorageError(error)
|
||||
|
||||
@@ -346,7 +346,7 @@ class AccountFileStorage(interfaces.AccountStorage):
|
||||
with util.safe_open(self._key_path(dir_path), "w", chmod=0o400) as key_file:
|
||||
key_file.write(account.key.json_dumps())
|
||||
|
||||
def _update_regr(self, account: Account, acme: ClientV2, dir_path: str) -> None:
|
||||
def _update_regr(self, account: Account, dir_path: str) -> None:
|
||||
with open(self._regr_path(dir_path), "w") as regr_file:
|
||||
regr = messages.RegistrationResource(
|
||||
body={},
|
||||
|
||||
@@ -948,7 +948,7 @@ def update_account(config: configuration.NamespaceConfig,
|
||||
# the v2 uri. Since it's the same object on disk, put it back to the v1 uri
|
||||
# so that we can also continue to use the account object with acmev1.
|
||||
acc.regr = acc.regr.update(uri=prev_regr_uri)
|
||||
account_storage.update_regr(acc, cb_client.acme)
|
||||
account_storage.update_regr(acc)
|
||||
|
||||
if not config.email:
|
||||
display_util.notify("Any contact information associated "
|
||||
|
||||
@@ -141,7 +141,7 @@ class AccountFileStorageTest(test_util.ConfigTestCase):
|
||||
self.assertEqual(self.acc, loaded)
|
||||
|
||||
def test_update_regr(self):
|
||||
self.storage.update_regr(self.acc, self.mock_client)
|
||||
self.storage.update_regr(self.acc)
|
||||
account_path = os.path.join(self.config.accounts_dir, self.acc.id)
|
||||
self.assertTrue(os.path.exists(account_path))
|
||||
self.assertTrue(os.path.exists(os.path.join(account_path, "regr.json")))
|
||||
|
||||
Reference in New Issue
Block a user