def get_amount_copied(src_path, dst_path, fs_handle):
rbytes = 'ceph.dir.rbytes'
- size_t = int(fs_handle.getxattr(src_path, rbytes))
- size_c = int(fs_handle.getxattr(dst_path, rbytes))
+ try:
+ size_t = int(fs_handle.getxattr(src_path, rbytes))
+ except ObjectNotFound:
+ log.info(f'get_amount_copied(): source path "{src_path}" went missing, '
+ 'couldn\'t run getxattr on it')
+ return
+
+ try:
+ size_c = int(fs_handle.getxattr(dst_path, rbytes))
+ except ObjectNotFound:
+ log.info(f'get_amount_copied(): destination path "{dst_path}" went '
+ 'missing, couldn\'t run getxattr on it')
+ return
percent: Optional[float]
if size_t == 0 or size_c == 0:
def get_percent_copied(src_path, dst_path, fs_handle):
- _, _, percent = get_amount_copied(src_path, dst_path, fs_handle)
- return percent
+ retval = get_amount_copied(src_path, dst_path, fs_handle)
+ if not retval:
+ return retval
+ else:
+ _, _, percent = retval
+ return percent
def get_stats(src_path, dst_path, fs_handle):
fs_handle:
percent = get_percent_copied(clone.src_path, clone.dst_path,
fs_handle)
+ if not percent:
+ continue
if clone in clones[:total_ongoing_clones]:
sum_percent_ongoing += percent
if show_onpen_bar: