X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fpolicy.py;h=eef18a4f343f4bde8fe8f17bb1900d4b2d2893d0;hb=fd457c8da7edfeb309999bd1a316f632bf130951;hp=3a1cb32ca2ad0c7e4955549c6b8ea3c92ca9d84c;hpb=d0c59ca05415c09d05d5945f22cc3cd68363fe71;p=dak.git diff --git a/daklib/policy.py b/daklib/policy.py index 3a1cb32c..eef18a4f 100644 --- a/daklib/policy.py +++ b/daklib/policy.py @@ -20,6 +20,7 @@ from .config import Config from .dbconn import BinaryMetadata, Component, MetadataKey, Override, OverrideType, get_mapped_component from .fstransactions import FilesystemTransaction from .regexes import re_file_changes, re_file_safe +import daklib.utils as utils import errno import os @@ -180,6 +181,8 @@ class PolicyQueueUploadHandler(object): @type reason: str @param reason: reason for the rejection """ + cnf = Config() + fn1 = 'REJECT.{0}'.format(self._changes_prefix) assert re_file_safe.match(fn1) @@ -187,6 +190,7 @@ class PolicyQueueUploadHandler(object): try: fh = os.open(fn, os.O_CREAT | os.O_EXCL | os.O_WRONLY) os.write(fh, 'NOTOK\n') + os.write(fh, 'From: {0} <{1}>\n\n'.format(utils.whoami(), cnf['Dinstall::MyAdminAddress'])) os.write(fh, reason) os.close(fh) except OSError as e: