@@ -106,18 +106,18 @@ def __init__(self, volclient, vol_spec):
106106 # reporting has already been initiated by calling RTimer.is_alive().
107107 self .update_task = RTimer (1 , self ._update_progress_bars )
108108
109+ # progress event ID for ongoing clone jobs
110+ self .on_pev_id : Optional [str ] = 'mgr-vol-ongoing-clones'
111+ # progress event ID for ongoing+pending clone jobs
112+ self .onpen_pev_id : Optional [str ] = 'mgr-vol-total-clones'
113+
109114 def initiate_reporting (self ):
110115 if self .update_task .is_alive ():
111116 log .info ('progress reporting thread is already alive, not '
112117 'initiating it again' )
113118 return
114119
115120 log .info ('initiating progress reporting for clones...' )
116- # progress event ID for ongoing clone jobs
117- self .on_pev_id : Optional [str ] = 'mgr-vol-ongoing-clones'
118- # progress event ID for ongoing+pending clone jobs
119- self .onpen_pev_id : Optional [str ] = 'mgr-vol-total-clones'
120-
121121 self .update_task = RTimer (1 , self ._update_progress_bars )
122122 self .update_task .start ()
123123 log .info ('progress reporting for clones has been initiated' )
@@ -294,10 +294,7 @@ def _finish_progress_events(self):
294294 assert self .onpen_pev_id is not None
295295
296296 self .volclient .mgr .remote ('progress' , 'complete' , self .on_pev_id )
297- self .on_pev_id = None
298-
299297 self .volclient .mgr .remote ('progress' , 'complete' , self .onpen_pev_id )
300- self .onpen_pev_id = None
301298
302299 log .info ('finished removing progress bars from "ceph status" output' )
303300
0 commit comments