Skip to content

Commit

Permalink
use attrs directly
Browse files Browse the repository at this point in the history
  • Loading branch information
meejah committed Feb 20, 2023
1 parent 464498f commit 5b14561
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/allmydata/cli/grid_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
)

import click
import attr

from twisted.python.filepath import (
FilePath,
Expand Down Expand Up @@ -196,7 +197,7 @@ def sign(ctx, name, expiry_days):
"No storage-server called '{}' exists".format(name)
)

certificate_data = json.dumps(certificate.asdict(), indent=4)
certificate_data = json.dumps(attr.asdict(certificate), indent=4)
click.echo(certificate_data)
if fp is not None:
next_serial = 0
Expand Down
8 changes: 4 additions & 4 deletions src/allmydata/grid_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
dictutil,
)

from attrs import define, asdict, Factory
from attrs import (
define,
Factory,
)


@define
Expand All @@ -41,9 +44,6 @@ def load(cls, file_like):
signature=data["signature"].encode("ascii")
)

def asdict(self):
return asdict(self)


@define
class _GridManagerStorageServer(object):
Expand Down

0 comments on commit 5b14561

Please sign in to comment.