@@ -3,6 +3,7 @@ use std::collections::VecDeque;
3
3
use crate :: spec:: { BootEntry , Host , HostSpec , HostStatus , ImageStatus } ;
4
4
use crate :: spec:: { ImageReference , ImageSignature } ;
5
5
use anyhow:: { Context , Result } ;
6
+ use fn_error_context:: context;
6
7
use ostree:: glib;
7
8
use ostree_container:: OstreeImageReference ;
8
9
use ostree_ext:: container as ostree_container;
@@ -104,6 +105,7 @@ pub(crate) fn labels_of_config(
104
105
config. config ( ) . as_ref ( ) . and_then ( |c| c. labels ( ) . as_ref ( ) )
105
106
}
106
107
108
+ #[ context( "Reading deployment metadata" ) ]
107
109
fn boot_entry_from_deployment (
108
110
sysroot : & SysrootLock ,
109
111
deployment : & ostree:: Deployment ,
@@ -183,6 +185,7 @@ pub(crate) fn get_status_require_booted(
183
185
184
186
/// Gather the ostree deployment objects, but also extract metadata from them into
185
187
/// a more native Rust structure.
188
+ #[ context( "Computing status" ) ]
186
189
pub ( crate ) fn get_status (
187
190
sysroot : & SysrootLock ,
188
191
booted_deployment : Option < & ostree:: Deployment > ,
@@ -217,16 +220,19 @@ pub(crate) fn get_status(
217
220
. staged
218
221
. as_ref ( )
219
222
. map ( |d| boot_entry_from_deployment ( sysroot, d) )
220
- . transpose ( ) ?;
223
+ . transpose ( )
224
+ . context ( "Staged deployment" ) ?;
221
225
let booted = booted_deployment
222
226
. as_ref ( )
223
227
. map ( |d| boot_entry_from_deployment ( sysroot, d) )
224
- . transpose ( ) ?;
228
+ . transpose ( )
229
+ . context ( "Booted deployment" ) ?;
225
230
let rollback = deployments
226
231
. rollback
227
232
. as_ref ( )
228
233
. map ( |d| boot_entry_from_deployment ( sysroot, d) )
229
- . transpose ( ) ?;
234
+ . transpose ( )
235
+ . context ( "Rollback deployment" ) ?;
230
236
let spec = staged
231
237
. as_ref ( )
232
238
. or ( booted. as_ref ( ) )
0 commit comments