@@ -48,24 +48,26 @@ def untrack(self, tracking_id):
4848 raise IndexException (- e .args [0 ], e .args [1 ])
4949
5050 def get_oldest_clone_entry (self , exclude = []):
51- min_ctime_entry = None
52- exclude_tracking_ids = [ v [ 0 ] for v in exclude ]
53- log . debug ( "excluded tracking ids: {0}" . format ( exclude_tracking_ids ))
54- for entry in list_one_entry_at_a_time ( self . fs , self . path ):
55- dname = entry . d_name
56- dpath = os . path . join ( self . path , dname )
57- st = self . fs . lstat ( dpath )
58- if dname not in exclude_tracking_ids and stat . S_ISLNK ( st . st_mode ):
59- if min_ctime_entry is None or st . st_ctime < min_ctime_entry [ 1 ]. st_ctime :
60- min_ctime_entry = ( dname , st )
61- if min_ctime_entry :
62- try :
51+ try :
52+ min_ctime_entry = None
53+ exclude_tracking_ids = [ v [ 0 ] for v in exclude ]
54+ log . debug ( "excluded tracking ids: {0}" . format ( exclude_tracking_ids ))
55+ for entry in list_one_entry_at_a_time ( self . fs , self . path ):
56+ dname = entry . d_name
57+ dpath = os . path . join ( self . path , dname )
58+ st = self . fs . lstat ( dpath )
59+ if dname not in exclude_tracking_ids and stat . S_ISLNK ( st . st_mode ) :
60+ if min_ctime_entry is None or st . st_ctime < min_ctime_entry [ 1 ]. st_ctime :
61+ min_ctime_entry = ( dname , st )
62+ if min_ctime_entry :
6363 linklen = min_ctime_entry [1 ].st_size
6464 sink_path = self .fs .readlink (os .path .join (self .path , min_ctime_entry [0 ]), CloneIndex .PATH_MAX )
6565 return (min_ctime_entry [0 ], sink_path [:linklen ])
66- except cephfs .Error as e :
67- raise IndexException (- e .args [0 ], e .args [1 ])
68- return None
66+ return None
67+ except cephfs .Error as e :
68+ log .debug ('Exception cephfs.Error has been caught. Printing '
69+ f'the exception - { e } ' )
70+ raise IndexException (- e .args [0 ], e .args [1 ])
6971
7072 def find_clone_entry_index (self , sink_path ):
7173 try :
0 commit comments