File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,16 @@ def _set_retry_status(_) -> None:
35
35
unit .status = ops .MaintenanceStatus (message )
36
36
logger .debug (message )
37
37
38
- try :
39
- for attempt in tenacity .Retrying (
40
- stop = tenacity .stop_after_delay (60 * 5 ),
41
- wait = tenacity .wait_exponential (multiplier = 10 ),
42
- retry = tenacity .retry_if_exception_type (snap_lib .SnapError ),
43
- after = _set_retry_status ,
44
- reraise = True ,
45
- ):
46
- with attempt :
47
- _snap .ensure (state = snap_lib .SnapState .Present , revision = _REVISION )
48
- except snap_lib .SnapError :
49
- raise
38
+ for attempt in tenacity .Retrying (
39
+ stop = tenacity .stop_after_delay (60 * 5 ),
40
+ wait = tenacity .wait_exponential (multiplier = 10 ),
41
+ retry = tenacity .retry_if_exception_type (snap_lib .SnapError ),
42
+ after = _set_retry_status ,
43
+ reraise = True ,
44
+ ):
45
+ with attempt :
46
+ _snap .ensure (state = snap_lib .SnapState .Present , revision = _REVISION )
47
+ _snap .hold ()
50
48
logger .debug (f"Installed { _SNAP_NAME = } , { _REVISION = } " )
51
49
52
50
You can’t perform that action at this time.
0 commit comments