X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fcommand.py;h=639611c2a7ee5c1cbc82c09b94279beee0319483;hb=9b194c0a49096be2d659906c98500d2981b75b53;hp=31551d7536162377c86dc1e3585a3d079439f8e5;hpb=dbd3ceac44904f678181a189f34dc75c56178953;p=dak.git diff --git a/daklib/command.py b/daklib/command.py index 31551d75..639611c2 100644 --- a/daklib/command.py +++ b/daklib/command.py @@ -72,6 +72,8 @@ class CommandFile(object): if action == 'dm': self.action_dm(self.fingerprint, section, session) + elif action == 'break-the-archive': + self.action_break_the_archive(self.fingerprint, section, session) else: raise CommandError('Unknown action: {0}'.format(action)) except StopIteration: @@ -206,6 +208,8 @@ class CommandFile(object): aps.acl = acl aps.fingerprint = fpr aps.source = source + aps.created_by = fingerprint + aps.reason = section.get('Reason') session.add(aps) self.log.log(['dm', 'allow', fpr.fingerprint, source]) self.result.append('Allowed: {0}'.format(source)) @@ -220,3 +224,11 @@ class CommandFile(object): self.result.append('Denied: {0}'.format(source)) session.commit() + + def action_break_the_archive(self, fingerprint, section, session): + name = 'Dave' + uid = fingerprint.uid + if uid is not None and uid.name is not None: + name = uid.name.split()[0] + + self.result.append("DAK9000: I'm sorry, {0}. I'm afraid I can't do that.".format(name))