From 07efe450b8c1f4e6c9fe49a7317d11dc26c04c6a Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Thu, 14 May 2020 11:06:54 +0200 Subject: [PATCH] pybind/mgr/snap_schedule: refactor Schedule ctor, make more args optional Signed-off-by: Jan Fajerski --- src/pybind/mgr/snap_schedule/fs/schedule.py | 8 ++++---- src/pybind/mgr/snap_schedule/module.py | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/snap_schedule/fs/schedule.py b/src/pybind/mgr/snap_schedule/fs/schedule.py index 68123fd9f6860..bba5abbe8a9b5 100644 --- a/src/pybind/mgr/snap_schedule/fs/schedule.py +++ b/src/pybind/mgr/snap_schedule/fs/schedule.py @@ -18,10 +18,10 @@ class Schedule(object): path, schedule, retention_policy, - start, fs_name, - subvol, rel_path, + start=None, + subvol=None, created=None, first=None, last=None, @@ -69,10 +69,10 @@ class Schedule(object): return cls(table_row['path'], table_row['schedule'], table_row['retention'], - table_row['start'], fs, - table_row['subvol'], table_row['rel_path'], + table_row['start'], + table_row['subvol'], table_row['created'], table_row['first'], table_row['last'], diff --git a/src/pybind/mgr/snap_schedule/module.py b/src/pybind/mgr/snap_schedule/module.py index 0d3564b3bd74f..f57920c14769a 100644 --- a/src/pybind/mgr/snap_schedule/module.py +++ b/src/pybind/mgr/snap_schedule/module.py @@ -96,8 +96,7 @@ class Module(MgrModule): use_fs = fs if fs else self.default_fs abs_path = self.resolve_subvolume_path(fs, subvol, path) self.client.store_snap_schedule(use_fs, abs_path, (abs_path, snap_schedule, - retention_policy, start, - use_fs, subvol, path)) + retention_policy, use_fs, path, start, subvol)) suc_msg = f'Schedule set for path {path}' except sqlite3.IntegrityError: existing_scheds = self.client.get_snap_schedules(use_fs, path) -- 2.39.5