Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ee9dea6
pybing/mgr/mgr_module: allow keyword arguments
Apr 16, 2020
2ec5a23
pybind/mgr/mgr_util: CephFSClient - add helper methods
May 6, 2020
26b94fe
snap_schedule: add initial interface and basic CRUD ops
May 6, 2020
29a6f72
spec: include snap_schedule in ceph spec file
vshankar Apr 28, 2020
39cbd13
pybind/mgr/snap_schedule: take snapshots according to schedule.
Nov 19, 2019
3f3df87
snap-schedule: Implement pruning according to retention specfication
May 6, 2020
92f21b1
snap_schedule: add metadata fields, refactor Schedule, multiple Sched…
Apr 3, 2020
6c63b35
pybind/mgr/snap-schedule: list - print ws separated results
May 6, 2020
759403a
pybind/mgr/snap-schedule: add interface to de-/activate schedules
May 13, 2020
aee0981
pybind/mgr/snap-schedule: refactor schedule into two modules
May 14, 2020
efc9ca0
pybing/mgr/snap_schedule: Add active flag to status report
May 14, 2020
07efe45
pybind/mgr/snap_schedule: refactor Schedule ctor, make more args opti…
May 14, 2020
f19114a
pybind/snap_schedule: return negative error codes
vshankar May 19, 2020
a48efa4
pybing/mgr/snap_sched: improve SQL statements, logging, metadata
May 19, 2020
5b9c924
pybind/mgr/snap_schedule: add unit tests
May 14, 2020
0af1449
pybind/mgr/snap-schedule: fix meta uniqueness contraint
May 27, 2020
5f0c5f2
pybing/mgr/snap_schedule: add more unit tests
May 28, 2020
8ebf967
pybing/mgr/snap_schedule: add separate retention interface
Jun 9, 2020
38a3e21
pybind/mgr/snap_schedule: integrate with mgr wide tox testing
Aug 6, 2020
39cf0d9
pybind/mgr/snap_schedule: add type hint for mypy, fix import
Aug 6, 2020
ed61ed9
pybing/mgr/snap_schedule: guard minute repeat interval
Aug 6, 2020
4d29eae
pybind/mgr/snap_schedule: datetime.fromisoformat fallbacks
Aug 10, 2020
b88b5e9
pybind/mgr/snap_schedule: fix import locations for unit tests
Aug 10, 2020
19f918a
pybind/mgr/snap_schedule: don't use as keyword in update statement
Aug 11, 2020
4823e65
pybing/mgr/snap_schedule: normalize dates to utc and ignore microseconds
Aug 12, 2020
6491e53
pybind/mgr/snap_schedule: fix imports for snap_schedule vs mgr wide t…
Aug 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -1647,6 +1647,7 @@ fi
%{_datadir}/ceph/mgr/rbd_support
%{_datadir}/ceph/mgr/restful
%{_datadir}/ceph/mgr/selftest
%{_datadir}/ceph/mgr/snap_schedule
%{_datadir}/ceph/mgr/status
%{_datadir}/ceph/mgr/telegraf
%{_datadir}/ceph/mgr/telemetry
Expand Down
1 change: 1 addition & 0 deletions debian/ceph-mgr-modules-core.install
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ usr/share/ceph/mgr/prometheus
usr/share/ceph/mgr/rbd_support
usr/share/ceph/mgr/restful
usr/share/ceph/mgr/selftest
usr/share/ceph/mgr/snap_schedule
usr/share/ceph/mgr/status
usr/share/ceph/mgr/telegraf
usr/share/ceph/mgr/telemetry
Expand Down
13 changes: 12 additions & 1 deletion src/pybind/mgr/mgr_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,21 @@ def __call__(self, func):

def call(self, mgr, cmd_dict, inbuf):
kwargs = {}
kwargs_switch = False
for a, d in self.args_dict.items():
if 'req' in d and d['req'] == "false" and a not in cmd_dict:
continue
kwargs[a.replace("-", "_")] = cmd_dict[a]
if kwargs_switch or (isinstance(cmd_dict[a], str) and '=' in cmd_dict[a]):
mgr.log.debug('found kwarg, assuming all following args are kw style')
kwargs_switch = True
try:
k, arg = cmd_dict[a].split('=')
except ValueError as e:
mgr.log.error('found positional arg after switching to kwarg parsing')
return -errno.EINVAL, '', 'Error EINVAL: postitional arg not allowed after kwarg'
kwargs[k.replace("-", "_")] = arg
else:
kwargs[a.replace("-", "_")] = cmd_dict[a]
if inbuf:
kwargs['inbuf'] = inbuf
assert self.func
Expand Down
19 changes: 19 additions & 0 deletions src/pybind/mgr/mgr_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,25 @@ def shutdown(self):
# second, delete all libcephfs handles from connection pool
self.connection_pool.del_all_handles()

def get_fs(self, fs_name):
fs_map = self.mgr.get('fs_map')
for fs in fs_map['filesystems']:
if fs['mdsmap']['fs_name'] == fs_name:
return fs
return None

def get_mds_names(self, fs_name):
fs = self.get_fs(fs_name)
if fs is None:
return []
return [mds['name'] for mds in fs['mdsmap']['info'].values()]

def get_metadata_pool(self, fs_name):
fs = self.get_fs(fs_name)
if fs:
return fs['mdsmap']['metadata_pool']
return None


@contextlib.contextmanager
def open_filesystem(fsc, fs_name):
Expand Down
1 change: 1 addition & 0 deletions src/pybind/mgr/snap_schedule/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.tox
11 changes: 11 additions & 0 deletions src/pybind/mgr/snap_schedule/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-

from os import environ

if 'SNAP_SCHED_UNITTEST' in environ:
import tests
Comment thread
vshankar marked this conversation as resolved.
Resolved
elif 'UNITTEST' in environ:
import tests
from .module import Module
else:
from .module import Module
Empty file.
Loading