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