Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions vmupdate/agent/source/plugins/manage_rpm_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
# USA.

import os

import pkg_resources
from packaging import version


def manage_rpm_macro(os_data, log, **kwargs):
Expand All @@ -31,7 +30,7 @@ def manage_rpm_macro(os_data, log, **kwargs):
if os_data["os_family"] == "RedHat":
rpm_macro = "/usr/lib/rpm/macros.d/macros.qubes"
if (os_data["id"] == "fedora"
and os_data["release"] < pkg_resources.parse_version("33")):
and os_data["release"] < version.parse("33")):
log.info("Old fedora version detected.")
with open(rpm_macro, "w") as file:
file.write("# CVE-2021-20271 mitigation\n"
Expand Down
4 changes: 1 addition & 3 deletions vmupdate/agent/source/plugins/updatesproxy_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.

import os
import pathlib
import pkg_resources


def updatesproxy_fix(os_data, log, **kwargs):
Expand All @@ -33,7 +31,7 @@ def updatesproxy_fix(os_data, log, **kwargs):
rpc_filename = "/etc/qubes-rpc/qubes.UpdatesProxy"
rpc_path = pathlib.Path(rpc_filename)
# qubes.UpdatesProxy file doesn't exist on template without
# qubes-core-agent-networking package
# a qubes-core-agent-networking package
if rpc_path.exists():
if "STDIO TCP:localhost:8082" in rpc_path.read_text():
with rpc_path.open("w") as f:
Expand Down
4 changes: 2 additions & 2 deletions vmupdate/agent/source/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import ast
from typing import Optional, Dict, Any

import pkg_resources
from packaging import version


def get_os_data(logger: Optional = None) -> Dict[str, Any]:
Expand All @@ -49,7 +49,7 @@ def get_os_data(logger: Optional = None) -> Dict[str, Any]:
data["name"] = os_release.get("NAME", "Linux").strip()
if "VERSION_ID" in os_release:
release = os_release["VERSION_ID"]
data["release"] = pkg_resources.parse_version(release)
data["release"] = version.parse(release)
if "VERSION_CODENAME" in os_release:
data["codename"] = os_release["VERSION_CODENAME"]

Expand Down