Skip to content
Snippets Groups Projects
Commit d1664f35 authored by Adriaan de Groot's avatar Adriaan de Groot
Browse files

[services-systemd] Correct Python key-checking

`has_key()` is a Python2-era form; use the `in` operator insteda.
parent 6235e04d
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ def systemctl(units): ...@@ -42,7 +42,7 @@ def systemctl(units):
action = "enable" action = "enable"
mandatory = False mandatory = False
else: else:
if not unit.has_key("name"): if "name" not in unit:
libcalamares.utils.error("The key 'name' is missing from the mapping {_unit!s}. Continuing to the next unit.".format(_unit=str(unit))) libcalamares.utils.error("The key 'name' is missing from the mapping {_unit!s}. Continuing to the next unit.".format(_unit=str(unit)))
continue continue
name = unit["name"] name = unit["name"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment