From: Venky Shankar Date: Tue, 19 May 2020 04:51:40 +0000 (-0400) Subject: pybind/snap_schedule: return negative error codes X-Git-Tag: v16.1.0~1299^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f19114a73328731d6dbddf7dd906559b8d3aaf25;p=ceph.git pybind/snap_schedule: return negative error codes Signed-off-by: Venky Shankar --- diff --git a/src/pybind/mgr/snap_schedule/module.py b/src/pybind/mgr/snap_schedule/module.py index f57920c1476..e87c085f80a 100644 --- a/src/pybind/mgr/snap_schedule/module.py +++ b/src/pybind/mgr/snap_schedule/module.py @@ -103,7 +103,7 @@ class Module(MgrModule): report = [s.report() for s in existing_scheds] error_msg = f'Found existing schedule {report}' self.log.error(error_msg) - return errno.EEXISTS, '', error_msg + return -errno.EEXIST, '', error_msg except CephfsConnectionException as e: return e.to_tuple() return 0, suc_msg, '' @@ -128,7 +128,7 @@ class Module(MgrModule): except CephfsConnectionException as e: return e.to_tuple() except ValueError as e: - return errno.ENOENT, '', str(e) + return -errno.ENOENT, '', str(e) return 0, 'Schedule removed for path {}'.format(path), '' @CLIWriteCommand('fs snap-schedule activate', @@ -151,7 +151,7 @@ class Module(MgrModule): except CephfsConnectionException as e: return e.to_tuple() except ValueError as e: - return errno.ENOENT, '', str(e) + return -errno.ENOENT, '', str(e) return 0, 'Schedule activated for path {}'.format(path), '' @CLIWriteCommand('fs snap-schedule deactivate', @@ -174,5 +174,5 @@ class Module(MgrModule): except CephfsConnectionException as e: return e.to_tuple() except ValueError as e: - return errno.ENOENT, '', str(e) + return -errno.ENOENT, '', str(e) return 0, 'Schedule deactivated for path {}'.format(path), ''