ret_scheds = self.client.get_snap_schedules(use_fs, path)
except CephfsConnectionException as e:
return e.to_tuple()
+ except Exception as e:
+ return -errno.EIO, '', str(e)
if format == 'json':
json_report = ','.join([ret_sched.report_json() for ret_sched in ret_scheds])
return 0, f'[{json_report}]', ''
self.log.debug(f'recursive is {recursive}')
except CephfsConnectionException as e:
return e.to_tuple()
+ except Exception as e:
+ return -errno.EIO, '', str(e)
if not scheds:
if format == 'json':
output: Dict[str, str] = {}
return -errno.ENOENT, '', str(e)
except CephfsConnectionException as e:
return e.to_tuple()
+ except Exception as e:
+ return -errno.EIO, '', str(e)
return 0, suc_msg, ''
@CLIWriteCommand('fs snap-schedule remove')
return -errno.EINVAL, '', f"no such filesystem: {use_fs}"
abs_path = path
self.client.rm_snap_schedule(use_fs, abs_path, repeat, start)
- except CephfsConnectionException as e:
- return e.to_tuple()
except ValueError as e:
return -errno.ENOENT, '', str(e)
+ except CephfsConnectionException as e:
+ return e.to_tuple()
+ except Exception as e:
+ return -errno.EIO, '', str(e)
return 0, 'Schedule removed for path {}'.format(path), ''
@CLIWriteCommand('fs snap-schedule retention add')
self.client.add_retention_spec(use_fs, abs_path,
retention_spec_or_period,
retention_count)
- except CephfsConnectionException as e:
- return e.to_tuple()
except ValueError as e:
return -errno.ENOENT, '', str(e)
+ except CephfsConnectionException as e:
+ return e.to_tuple()
+ except Exception as e:
+ return -errno.EIO, '', str(e)
return 0, 'Retention added to path {}'.format(path), ''
@CLIWriteCommand('fs snap-schedule retention remove')
self.client.rm_retention_spec(use_fs, abs_path,
retention_spec_or_period,
retention_count)
- except CephfsConnectionException as e:
- return e.to_tuple()
except ValueError as e:
return -errno.ENOENT, '', str(e)
+ except CephfsConnectionException as e:
+ return e.to_tuple()
+ except Exception as e:
+ return -errno.EIO, '', str(e)
return 0, 'Retention removed from path {}'.format(path), ''
@CLIWriteCommand('fs snap-schedule activate')
return -errno.EINVAL, '', f"no such filesystem: {use_fs}"
abs_path = path
self.client.activate_snap_schedule(use_fs, abs_path, repeat, start)
- except CephfsConnectionException as e:
- return e.to_tuple()
except ValueError as e:
return -errno.ENOENT, '', str(e)
+ except CephfsConnectionException as e:
+ return e.to_tuple()
+ except Exception as e:
+ return -errno.EIO, '', str(e)
return 0, 'Schedule activated for path {}'.format(path), ''
@CLIWriteCommand('fs snap-schedule deactivate')
return -errno.EINVAL, '', f"no such filesystem: {use_fs}"
abs_path = path
self.client.deactivate_snap_schedule(use_fs, abs_path, repeat, start)
- except CephfsConnectionException as e:
- return e.to_tuple()
except ValueError as e:
return -errno.ENOENT, '', str(e)
+ except CephfsConnectionException as e:
+ return e.to_tuple()
+ except Exception as e:
+ return -errno.EIO, '', str(e)
return 0, 'Schedule deactivated for path {}'.format(path), ''