diff options
Diffstat (limited to 'meta-security-compliance/recipes-openscap/openscap-daemon')
2 files changed, 0 insertions, 153 deletions
diff --git a/meta-security-compliance/recipes-openscap/openscap-daemon/files/0001-Renamed-module-and-variables-to-get-rid-of-async.patch b/meta-security-compliance/recipes-openscap/openscap-daemon/files/0001-Renamed-module-and-variables-to-get-rid-of-async.patch deleted file mode 100644 index 2a518bf..0000000 --- a/meta-security-compliance/recipes-openscap/openscap-daemon/files/0001-Renamed-module-and-variables-to-get-rid-of-async.patch +++ /dev/null | |||
@@ -1,130 +0,0 @@ | |||
1 | From c34349720a57997d30946286756e2ba9dbab6ace Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Mat=C4=9Bj=20T=C3=BD=C4=8D?= <matyc@redhat.com> | ||
3 | Date: Mon, 2 Jul 2018 11:21:19 +0200 | ||
4 | Subject: [PATCH] Renamed module and variables to get rid of async. | ||
5 | |||
6 | async is a reserved word in Python 3.7. | ||
7 | |||
8 | Upstream-Status: Backport | ||
9 | [https://github.com/OpenSCAP/openscap-daemon/commit/c34349720a57997d30946286756e2ba9dbab6ace] | ||
10 | |||
11 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
12 | --- | ||
13 | openscap_daemon/{async.py => async_tools.py} | 0 | ||
14 | openscap_daemon/dbus_daemon.py | 2 +- | ||
15 | openscap_daemon/system.py | 16 ++++++++-------- | ||
16 | tests/unit/test_basic_update.py | 3 ++- | ||
17 | 4 files changed, 11 insertions(+), 10 deletions(-) | ||
18 | rename openscap_daemon/{async.py => async_tools.py} (100%) | ||
19 | |||
20 | diff --git a/openscap_daemon/async.py b/openscap_daemon/async_tools.py | ||
21 | similarity index 100% | ||
22 | rename from openscap_daemon/async.py | ||
23 | rename to openscap_daemon/async_tools.py | ||
24 | diff --git a/openscap_daemon/dbus_daemon.py b/openscap_daemon/dbus_daemon.py | ||
25 | index e6eadf9..cb6a8b6 100644 | ||
26 | --- a/openscap_daemon/dbus_daemon.py | ||
27 | +++ b/openscap_daemon/dbus_daemon.py | ||
28 | @@ -81,7 +81,7 @@ class OpenSCAPDaemonDbus(dbus.service.Object): | ||
29 | @dbus.service.method(dbus_interface=dbus_utils.DBUS_INTERFACE, | ||
30 | in_signature="", out_signature="a(xsi)") | ||
31 | def GetAsyncActionsStatus(self): | ||
32 | - return self.system.async.get_status() | ||
33 | + return self.system.async_manager.get_status() | ||
34 | |||
35 | @dbus.service.method(dbus_interface=dbus_utils.DBUS_INTERFACE, | ||
36 | in_signature="s", out_signature="(sssn)") | ||
37 | diff --git a/openscap_daemon/system.py b/openscap_daemon/system.py | ||
38 | index 2012f6e..85c2680 100644 | ||
39 | --- a/openscap_daemon/system.py | ||
40 | +++ b/openscap_daemon/system.py | ||
41 | @@ -26,7 +26,7 @@ import logging | ||
42 | from openscap_daemon.task import Task | ||
43 | from openscap_daemon.config import Configuration | ||
44 | from openscap_daemon import oscap_helpers | ||
45 | -from openscap_daemon import async | ||
46 | +from openscap_daemon import async_tools | ||
47 | |||
48 | |||
49 | class ResultsNotAvailable(Exception): | ||
50 | @@ -40,7 +40,7 @@ TASK_ACTION_PRIORITY = 10 | ||
51 | |||
52 | class System(object): | ||
53 | def __init__(self, config_file): | ||
54 | - self.async = async.AsyncManager() | ||
55 | + self.async_manager = async_tools.AsyncManager() | ||
56 | |||
57 | logging.info("Loading configuration from '%s'.", config_file) | ||
58 | self.config = Configuration() | ||
59 | @@ -90,7 +90,7 @@ class System(object): | ||
60 | input_file, tailoring_file, None | ||
61 | ) | ||
62 | |||
63 | - class AsyncEvaluateSpecAction(async.AsyncAction): | ||
64 | + class AsyncEvaluateSpecAction(async_tools.AsyncAction): | ||
65 | def __init__(self, system, spec): | ||
66 | super(System.AsyncEvaluateSpecAction, self).__init__() | ||
67 | |||
68 | @@ -113,7 +113,7 @@ class System(object): | ||
69 | return "Evaluate Spec '%s'" % (self.spec) | ||
70 | |||
71 | def evaluate_spec_async(self, spec): | ||
72 | - return self.async.enqueue( | ||
73 | + return self.async_manager.enqueue( | ||
74 | System.AsyncEvaluateSpecAction( | ||
75 | self, | ||
76 | spec | ||
77 | @@ -488,7 +488,7 @@ class System(object): | ||
78 | |||
79 | return ret | ||
80 | |||
81 | - class AsyncUpdateTaskAction(async.AsyncAction): | ||
82 | + class AsyncUpdateTaskAction(async_tools.AsyncAction): | ||
83 | def __init__(self, system, task_id, reference_datetime): | ||
84 | super(System.AsyncUpdateTaskAction, self).__init__() | ||
85 | |||
86 | @@ -536,7 +536,7 @@ class System(object): | ||
87 | |||
88 | if task.should_be_updated(reference_datetime): | ||
89 | self.tasks_scheduled.add(task.id_) | ||
90 | - self.async.enqueue( | ||
91 | + self.async_manager.enqueue( | ||
92 | System.AsyncUpdateTaskAction( | ||
93 | self, | ||
94 | task.id_, | ||
95 | @@ -662,7 +662,7 @@ class System(object): | ||
96 | fix_type | ||
97 | ) | ||
98 | |||
99 | - class AsyncEvaluateCVEScannerWorkerAction(async.AsyncAction): | ||
100 | + class AsyncEvaluateCVEScannerWorkerAction(async_tools.AsyncAction): | ||
101 | def __init__(self, system, worker): | ||
102 | super(System.AsyncEvaluateCVEScannerWorkerAction, self).__init__() | ||
103 | |||
104 | @@ -680,7 +680,7 @@ class System(object): | ||
105 | return "Evaluate CVE Scanner Worker '%s'" % (self.worker) | ||
106 | |||
107 | def evaluate_cve_scanner_worker_async(self, worker): | ||
108 | - return self.async.enqueue( | ||
109 | + return self.async_manager.enqueue( | ||
110 | System.AsyncEvaluateCVEScannerWorkerAction( | ||
111 | self, | ||
112 | worker | ||
113 | diff --git a/tests/unit/test_basic_update.py b/tests/unit/test_basic_update.py | ||
114 | index 6f683e6..7f953f7 100755 | ||
115 | --- a/tests/unit/test_basic_update.py | ||
116 | +++ b/tests/unit/test_basic_update.py | ||
117 | @@ -37,8 +37,9 @@ class BasicUpdateTest(unit_test_harness.APITest): | ||
118 | print(self.system.tasks) | ||
119 | self.system.schedule_tasks() | ||
120 | |||
121 | - while len(self.system.async.actions) > 0: | ||
122 | + while len(self.system.async_manager.actions) > 0: | ||
123 | time.sleep(1) | ||
124 | |||
125 | + | ||
126 | if __name__ == "__main__": | ||
127 | BasicUpdateTest.run() | ||
128 | -- | ||
129 | 2.7.4 | ||
130 | |||
diff --git a/meta-security-compliance/recipes-openscap/openscap-daemon/openscap-daemon_0.1.10.bb b/meta-security-compliance/recipes-openscap/openscap-daemon/openscap-daemon_0.1.10.bb deleted file mode 100644 index 9659323..0000000 --- a/meta-security-compliance/recipes-openscap/openscap-daemon/openscap-daemon_0.1.10.bb +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | # Copyright (C) 2017 Armin Kuster <akuster808@gmail.com> | ||
2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
3 | |||
4 | SUMARRY = "The OpenSCAP Daemon is a service that runs in the background." | ||
5 | HOME_URL = "https://www.open-scap.org/tools/openscap-daemon/" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=40d2542b8c43a3ec2b7f5da31a697b88" | ||
7 | LICENSE = "LGPL-2.1-only" | ||
8 | |||
9 | DEPENDS = "python3-dbus" | ||
10 | |||
11 | SRCREV = "f25b16afb6ac761fea13132ff406fba4cdfd2b76" | ||
12 | SRC_URI = "git://github.com/OpenSCAP/openscap-daemon.git;branch=master;protocol=https \ | ||
13 | file://0001-Renamed-module-and-variables-to-get-rid-of-async.patch \ | ||
14 | " | ||
15 | |||
16 | inherit python_setuptools_build_meta | ||
17 | |||
18 | S = "${WORKDIR}/git" | ||
19 | |||
20 | RDEPENDS:${PN} = "openscap scap-security-guide \ | ||
21 | python3-core python3-dbus \ | ||
22 | python3-pygobject \ | ||
23 | " | ||