|
10 | 10 | # See the License for the specific language governing permissions and |
11 | 11 | # limitations under the License. |
12 | 12 |
|
| 13 | +import functools |
| 14 | + |
13 | 15 | from testinfra.modules.base import Module |
14 | | -from testinfra.utils import cached_property |
15 | 16 |
|
16 | 17 |
|
17 | 18 | class Service(Module): |
@@ -60,7 +61,7 @@ def is_masked(self): |
60 | 61 | """ |
61 | 62 | raise NotImplementedError |
62 | 63 |
|
63 | | - @cached_property |
| 64 | + @functools.cached_property |
64 | 65 | def systemd_properties(self): |
65 | 66 | """Properties of the service (unit). |
66 | 67 |
|
@@ -112,7 +113,7 @@ def __repr__(self): |
112 | 113 |
|
113 | 114 |
|
114 | 115 | class SysvService(Service): |
115 | | - @cached_property |
| 116 | + @functools.cached_property |
116 | 117 | def _service_command(self): |
117 | 118 | return self.find_command("service") |
118 | 119 |
|
@@ -181,7 +182,7 @@ def is_masked(self): |
181 | 182 | cmd = self.run_test("systemctl is-enabled %s", self.name) |
182 | 183 | return cmd.stdout.strip() == "masked" |
183 | 184 |
|
184 | | - @cached_property |
| 185 | + @functools.cached_property |
185 | 186 | def systemd_properties(self): |
186 | 187 | out = self.check_output("systemctl show %s", self.name) |
187 | 188 | out_d = {} |
@@ -221,7 +222,7 @@ def is_running(self): |
221 | 222 |
|
222 | 223 |
|
223 | 224 | class OpenRCService(SysvService): |
224 | | - @cached_property |
| 225 | + @functools.cached_property |
225 | 226 | def _service_command(self): |
226 | 227 | return self.find_command("rc-service") |
227 | 228 |
|
|
0 commit comments