summaryrefslogtreecommitdiff
path: root/cloudinit/cmd
diff options
context:
space:
mode:
authorAlberto Contreras <aciba90@gmail.com>2022-05-23 18:30:00 +0200
committerGitHub <noreply@github.com>2022-05-23 11:30:00 -0500
commit53a995e2f852d043d51ad25c1b9afbbe1edafd57 (patch)
treea91be715e11a2cc509a4c953e8f456154ed60589 /cloudinit/cmd
parent4938c9c1407cdc21daabd70791300c3058a16f71 (diff)
downloadcloud-init-git-53a995e2f852d043d51ad25c1b9afbbe1edafd57.tar.gz
Drop mypy excluded files (#1454)
- Add types to let mypy pass. - Add mypy flags: - detect unused ignores - redundant casts - Drop support of `ConfigParser` in Python 2 - Harden DataSourceLXD.network_config - Convert old-style commented types to proper types.
Diffstat (limited to 'cloudinit/cmd')
-rwxr-xr-xcloudinit/cmd/devel/hotplug_hook.py4
-rwxr-xr-xcloudinit/cmd/query.py1
2 files changed, 2 insertions, 3 deletions
diff --git a/cloudinit/cmd/devel/hotplug_hook.py b/cloudinit/cmd/devel/hotplug_hook.py
index 29439911..bc8f3ef3 100755
--- a/cloudinit/cmd/devel/hotplug_hook.py
+++ b/cloudinit/cmd/devel/hotplug_hook.py
@@ -202,12 +202,12 @@ def handle_hotplug(hotplug_init: Init, devpath, subsystem, udevaction):
return
handler_cls = SUBSYSTEM_PROPERTES_MAP[subsystem][0]
LOG.debug("Creating %s event handler", subsystem)
- event_handler = handler_cls(
+ event_handler: UeventHandler = handler_cls(
datasource=datasource,
devpath=devpath,
action=udevaction,
success_fn=hotplug_init._write_to_cache,
- ) # type: UeventHandler
+ )
wait_times = [1, 3, 5, 10, 30]
last_exception = Exception("Bug while processing hotplug event.")
for attempt, wait in enumerate(wait_times):
diff --git a/cloudinit/cmd/query.py b/cloudinit/cmd/query.py
index b9347200..2dcd8e44 100755
--- a/cloudinit/cmd/query.py
+++ b/cloudinit/cmd/query.py
@@ -150,7 +150,6 @@ def _read_instance_data(instance_data, user_data, vendor_data) -> dict:
:raise: IOError/OSError on absence of instance-data.json file or invalid
access perms.
"""
- paths = None
uid = os.getuid()
if not all([instance_data, user_data, vendor_data]):
paths = read_cfg_paths()