def is_enabled(cls): if os.geteuid() != 0: log.debug("btrfs is only enabled for the root user!") return False if not sys.platform.startswith('linux'): log.debug("btrfs is only enabled on linux!") return False elif BTRFS_AVAILABLE: if "v0.19" in btrfs_cmd("--version"): log.warning("'btrfs' command v0.19 is incompatible, please upgrade to at least v0.20 to enable btrfs") return False return True else: return False
def get_old_snapshots(self, keep, interval=None): old_snapshots = [] for d in self.get_datasets(): if interval: snapshots = self.filter_snapshots(dataset=d, interval=interval) if keep == 0: old_snapshots = [] else: old_snapshots = old_snapshots + snapshots[:-keep] else: log.warning("get_old_snapshots: THIS SHOULD PROBABLY NEVER RUN!") for i in self.intervals: x = [s for s in self.get_snapshots() if s.interval == i] if keep == 0: old_snapshots = [] else: old_snapshots = old_snapshots + x[:-keep] return old_snapshots
def print_snapshot(self, dataset, label): log.warning("Unimplemented Method: print_snapshot()")
def destroy_snapshot(self, name): log.warning("Unimplemented Method: destroy_snapshot()")
def get_snapshot_size(self, snapshot): log.warning("Unimplemented Method: get_snapshot_size()")
def commit_snapshot(self, filesystem, interval, label): log.warning("Unimplemented Method: commit_snapshot()")
def get_config(self): log.warning("Unimplemented Method: get_config()")
def get_snapshots(self, filesystem=None): log.warning("Unimplemented Method: get_snapshots()")
def get_datasets(self): log.warning("no datasets for fake interface")
def is_enabled(self): log.warning("Unimplemented Method: is_enabled()") return False