Skip to content

Commit ab9be36

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

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

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)