Skip to content

Commit d6043d3

Browse files
committed
Time out after ten seconds for long-running methods
Signed-off-by: mulhern <amulhern@redhat.com>
1 parent 68f1a0e commit d6043d3

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ classifiers=
2626
python_requires = >=3.12
2727
install_requires =
2828
dbus-client-gen>=0.4
29-
dbus-python-client-gen>=0.7
29+
dbus-python-client-gen>=0.8.4
3030
justbytes>=0.14
3131
packaging
3232
psutil

src/stratis_cli/_actions/_crypt.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def encrypt(namespace: Namespace):
8686
]
8787
),
8888
},
89+
timeout=10,
8990
)
9091

9192
if return_code != StratisdErrors.OK:
@@ -127,7 +128,9 @@ def unencrypt(namespace: Namespace):
127128
raise StratisCliNoChangeError("encryption off", pool_id)
128129

129130
(changed, return_code, message) = Pool.Methods.DecryptPool(
130-
get_object(pool_object_path), {}
131+
get_object(pool_object_path),
132+
{},
133+
timeout=10,
131134
)
132135

133136
if return_code != StratisdErrors.OK: # pragma: no cover
@@ -166,7 +169,9 @@ def reencrypt(namespace: Namespace):
166169
)
167170

168171
(changed, return_code, message) = Pool.Methods.ReencryptPool(
169-
get_object(pool_object_path), {}
172+
get_object(pool_object_path),
173+
{},
174+
timeout=10,
170175
)
171176

172177
if return_code != StratisdErrors.OK:

0 commit comments

Comments
 (0)