diff options
author | Alberto Contreras <aciba90@gmail.com> | 2022-04-28 19:50:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 11:50:23 -0600 |
commit | 1f0baf383cb1e3d93063bdc51780f00aa3f3da06 (patch) | |
tree | a684c447de6f0d9bf24298c0e66abc9da1971f55 /cloudinit/cmd | |
parent | 4d6576560de01ab4f4a75924a5b7b81fd9e5bd2a (diff) | |
download | cloud-init-git-1f0baf383cb1e3d93063bdc51780f00aa3f3da06.tar.gz |
Refactor cloudinit.sources.NetworkConfigSource to enum (#1413)
It was implemented as a namedtuple, because it was written
when the codebase supported Python 2 (where using an enum would have
introduced a new dependency). As enum is in the stdlib in all our
supported Python releases, we can now use it without that constraint.
LP: #1874875
Diffstat (limited to 'cloudinit/cmd')
-rw-r--r-- | cloudinit/cmd/devel/hotplug_hook.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cloudinit/cmd/devel/hotplug_hook.py b/cloudinit/cmd/devel/hotplug_hook.py index a9be0379..7f663d24 100644 --- a/cloudinit/cmd/devel/hotplug_hook.py +++ b/cloudinit/cmd/devel/hotplug_hook.py @@ -11,8 +11,7 @@ from cloudinit.event import EventScope, EventType from cloudinit.net import activators, read_sys_net_safe from cloudinit.net.network_state import parse_net_config_data from cloudinit.reporting import events -from cloudinit.sources import DataSource # noqa: F401 -from cloudinit.sources import DataSourceNotFoundException +from cloudinit.sources import DataSource, DataSourceNotFoundException from cloudinit.stages import Init LOG = log.getLogger(__name__) @@ -72,7 +71,7 @@ def get_parser(parser=None): class UeventHandler(abc.ABC): def __init__(self, id, datasource, devpath, action, success_fn): self.id = id - self.datasource = datasource # type: DataSource + self.datasource: DataSource = datasource self.devpath = devpath self.action = action self.success_fn = success_fn |