예제 #1
0
def subvolume_clean():
    sub = args.subvolume_clean
    if sub != '/':  # Prevent strip filesystem root.
        sub = sub.rstrip('/')

    found = False
    for i in settings.sections:
        if sub == settings.config[i]['subvolume']:
            found = True
            x = Section(settings.config[i])
            x.snapshot_clean()
    if not found:
        clean_exit('No section manages the subvolume: ' + sub, BADSUB)
예제 #2
0
파일: gui.py 프로젝트: mdomlop/snapman
    def delete(self):
        failed = []
        ok = False
        for s in self.selected:
            x = Section(settings.config[s])
            if x.snapshot_clean():
                ok = True
            else:
                failed.append(s)

        if failed:
            text = 'Failed to clean sections: \n\n' + '\n'.join(failed) + '\
            \n\nMaybe are not you root?'

            title = 'Operation failed'
            self.mbox.warning(self, title, text, self.mbox.Ok)

        if ok:  # Only update table if some were deleted
            self.reloadTable()
예제 #3
0
def section_clean():
    s = args.section_clean.rstrip('/')
    x = Section(settings.config[s])
    x.snapshot_clean()
예제 #4
0
def section_clean():
    for i in Snapman.args.targets:
        s = i.rstrip('/')
        x = Section(settings.config[s])
        x.snapshot_clean()