From 7f6517eee61c970720995a2464ec3dc6a8555e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Tue, 1 Jan 2019 23:19:15 +0100 Subject: [PATCH] Handle non existing qubessaltpatches in case where mgmt-salt-base-overrides is not needed anymore --- qubessalt/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qubessalt/__init__.py b/qubessalt/__init__.py index 6d7e0d3..140256c 100644 --- a/qubessalt/__init__.py +++ b/qubessalt/__init__.py @@ -39,7 +39,10 @@ import salt.config import qubesadmin.exc import qubesadmin.vm -import qubessaltpatches +try: + import qubessaltpatches +except ImportError: + pass FORMAT_LOG = '%(asctime)s %(message)s' LOGPATH = '/var/log/qubes' @@ -205,7 +208,10 @@ def __init__(self, app, vms, command, max_concurrency=4, show_output=False, self._opts['file_client'] = 'local' # this do patch already imported salt modules - import qubessaltpatches + try: + import qubessaltpatches + except ImportError: + pass def collect_result(self, result_tuple): name, result = result_tuple