def row_to_rule(row): # ('/home/ariel/wmf/security', '/home/ariel/wmf/security/openjdk6', 'D', 'G') (basedir, name, entrytype, status) = row basedir = clouseau.retention.utils.rule.from_unicode(basedir) name = clouseau.retention.utils.rule.from_unicode(name) rule = {'path': os.path.join(basedir, name), 'type': entrytype_to_text(entrytype), 'status': Status.status_to_text(status)} return rule
def row_to_rule(row): # ('/home/ariel/wmf/security', '/home/ariel/wmf/security/openjdk6', 'D', 'G') (basedir, name, entrytype, status) = row basedir = clouseau.retention.utils.rule.from_unicode(basedir) name = clouseau.retention.utils.rule.from_unicode(name) rule = { 'path': os.path.join(basedir, name), 'type': entrytype_to_text(entrytype), 'status': Status.status_to_text(status) } return rule
def check_args(hosts, action, status): if hosts is None: usage("Mandatory 'hosts' argument not specified") if action is None: usage("Mandatory 'action' argument not specified") if action not in ['show', 'delete', 'add']: usage('unknown action %s specified' % action) if status is not None: status = Status.status_to_text(status) if status is None: usage('unknown status %s specified' % status)
def check_args(hosts, action, status): if hosts is None: usage("Mandatory 'hosts' argument not specified") if action is None: usage("Mandatory 'action' argument not specified") if action not in ['show', 'delete', 'add']: usage('unknown action %s specified' % action) if status is not None: status = Status.status_to_text(status) if status is None: usage('unknown status %s specified' % status)