]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/snap_schedule: refactor Schedule ctor, make more args optional
authorJan Fajerski <jfajerski@suse.com>
Thu, 14 May 2020 09:06:54 +0000 (11:06 +0200)
committerJan Fajerski <jfajerski@suse.com>
Thu, 27 Aug 2020 13:55:46 +0000 (15:55 +0200)
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
src/pybind/mgr/snap_schedule/fs/schedule.py
src/pybind/mgr/snap_schedule/module.py

index 68123fd9f68604429f7ab53289eefef83693e523..bba5abbe8a9b5ea77feb1597cddbb929bd590ed0 100644 (file)
@@ -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'],
index 0d3564b3bd74fb8c7833ceb9cb6e27b3fe0ec863..f57920c14769ace54fcd5d2612fd5483decbacb1 100644 (file)
@@ -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)