prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  build_reporting fails if empty string in ignorelist
  The default configuration in the ubuntu 12.04 cobbler 2.6.5 package has the following in `/etc/settings`:
  
  ```
  build_reporting_ignorelist = [""]
  ```
  
  The code that reads this value is in `install_post_report.py`, and the condition that determines whether to send a build report email is:
  
  ```
  for prefix in settings.build_reporting_ignorelist:
    if name.lower().startswith(prefix) == True:
      sendmail = False
  ```
  
  With the default configuration, this check always succeeds, and **mail is not sent**.
  
  Fix the issue by modifying the condition to:
  
  ```
    if prefix != '' and name.lower().startswith(prefix):
  ```
  
  
  </issue>
  <code>
  [start of cobbler/modules/install_post_report.py]
  1 # (c) 2008-2009
  2 # Jeff Schroeder <jeffschroeder@computer.org>
  3 # Michael DeHaan <michael.dehaan AT gmail>
  4 #
  5 # License: GPLv2+
  6 
  7 # Post install trigger for cobbler to
  8 # send out a pretty email report that
  9 # contains target information.
  10 
  11 import distutils.sysconfig
  12 import sys
  13 import os
  14 import traceback
  15 
  16 plib = distutils.sysconfig.get_python_lib()
  17 mod_path="%s/cobbler" % plib
  18 sys.path.insert(0, mod_path)
  19 
  20 from utils import _
  21 import smtplib
  22 import sys
  23 import cobbler.templar as templar
  24 from cobbler.cexceptions import CX
  25 import utils
  26 
  27 def register():
  28    # this pure python trigger acts as if it were a legacy shell-trigger, but is much faster.
  29    # the return of this method indicates the trigger type
  30    return "/var/lib/cobbler/triggers/install/post/*"
  31 
  32 def run(api, args, logger):
  33     # FIXME: make everything use the logger
  34 
  35     settings = api.settings()
  36 
  37     # go no further if this feature is turned off
  38     if not str(settings.build_reporting_enabled).lower() in [ "1", "yes", "y", "true"]:
  39         return 0
  40 
  41     objtype = args[0] # "target" or "profile"
  42     name    = args[1] # name of target or profile
  43     boot_ip = args[2] # ip or "?"
  44 
  45     if objtype == "system":
  46         target = api.find_system(name)
  47     else:
  48         target = api.find_profile(name)
  49 
  50     # collapse the object down to a rendered datastructure
  51     target = utils.blender(api, False, target)
  52 
  53     if target == {}:
  54         raise CX("failure looking up target")
  55 
  56     to_addr = settings.build_reporting_email
  57     if to_addr == "":
  58         return 0
  59 
  60     # add the ability to specify an MTA for servers that don't run their own
  61     smtp_server = settings.build_reporting_smtp_server
  62     if smtp_server == "":
  63         smtp_server = "localhost"
  64 
  65     # use a custom from address or fall back to a reasonable default
  66     from_addr = settings.build_reporting_sender
  67     if from_addr == "":
  68         from_addr = "cobbler@%s" % settings.server
  69 
  70     subject = settings.build_reporting_subject
  71     if subject == "":
  72         subject = '[Cobbler] install complete '
  73 
  74     to_addr = ",".join(to_addr)
  75     metadata = {
  76         "from_addr" : from_addr,
  77         "to_addr"   : to_addr,
  78         "subject"   : subject,
  79         "boot_ip"   : boot_ip
  80     }
  81     metadata.update(target)
  82 
  83     input_template = open("/etc/cobbler/reporting/build_report_email.template")
  84     input_data = input_template.read()
  85     input_template.close()
  86 
  87     message = templar.Templar(api._config).render(input_data, metadata, None)
  88     
  89     # for debug, call
  90     # print message
  91 
  92     sendmail = True
  93     for prefix in settings.build_reporting_ignorelist:
  94         if name.lower().startswith(prefix) == True:
  95             sendmail = False
  96 
  97     if sendmail == True:
  98         # Send the mail
  99         # FIXME: on error, return non-zero
  100         server_handle = smtplib.SMTP(smtp_server)
  101         server_handle.sendmail(from_addr, to_addr.split(','), message)
  102         server_handle.quit()
  103 
  104     return 0
  105 
  106 
  107 
  108 
  109
  [end of cobbler/modules/install_post_report.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/cobbler/modules/install_post_report.py b/cobbler/modules/install_post_report.py
  --- a/cobbler/modules/install_post_report.py
  +++ b/cobbler/modules/install_post_report.py
  @@ -91,7 +91,7 @@
   
       sendmail = True
       for prefix in settings.build_reporting_ignorelist:
  -        if name.lower().startswith(prefix) == True:
  +        if prefix != '' and name.lower().startswith(prefix):
               sendmail = False
   
       if sendmail == True:
  
verification_info: {"golden_diff": "diff --git a/cobbler/modules/install_post_report.py b/cobbler/modules/install_post_report.py\n--- a/cobbler/modules/install_post_report.py\n+++ b/cobbler/modules/install_post_report.py\n@@ -91,7 +91,7 @@\n \n     sendmail = True\n     for prefix in settings.build_reporting_ignorelist:\n-        if name.lower().startswith(prefix) == True:\n+        if prefix != '' and name.lower().startswith(prefix):\n             sendmail = False\n \n     if sendmail == True:\n", "issue": "build_reporting fails if empty string in ignorelist\nThe default configuration in the ubuntu 12.04 cobbler 2.6.5 package has the following in `/etc/settings`:\n\n```\nbuild_reporting_ignorelist = [\"\"]\n```\n\nThe code that reads this value is in `install_post_report.py`, and the condition that determines whether to send a build report email is:\n\n```\nfor prefix in settings.build_reporting_ignorelist:\n  if name.lower().startswith(prefix) == True:\n    sendmail = False\n```\n\nWith the default configuration, this check always succeeds, and **mail is not sent**.\n\nFix the issue by modifying the condition to:\n\n```\n  if prefix != '' and name.lower().startswith(prefix):\n```\n\n", "before_files": [{"content": "# (c) 2008-2009\n# Jeff Schroeder <jeffschroeder@computer.org>\n# Michael DeHaan <michael.dehaan AT gmail>\n#\n# License: GPLv2+\n\n# Post install trigger for cobbler to\n# send out a pretty email report that\n# contains target information.\n\nimport distutils.sysconfig\nimport sys\nimport os\nimport traceback\n\nplib = distutils.sysconfig.get_python_lib()\nmod_path=\"%s/cobbler\" % plib\nsys.path.insert(0, mod_path)\n\nfrom utils import _\nimport smtplib\nimport sys\nimport cobbler.templar as templar\nfrom cobbler.cexceptions import CX\nimport utils\n\ndef register():\n   # this pure python trigger acts as if it were a legacy shell-trigger, but is much faster.\n   # the return of this method indicates the trigger type\n   return \"/var/lib/cobbler/triggers/install/post/*\"\n\ndef run(api, args, logger):\n    # FIXME: make everything use the logger\n\n    settings = api.settings()\n\n    # go no further if this feature is turned off\n    if not str(settings.build_reporting_enabled).lower() in [ \"1\", \"yes\", \"y\", \"true\"]:\n        return 0\n\n    objtype = args[0] # \"target\" or \"profile\"\n    name    = args[1] # name of target or profile\n    boot_ip = args[2] # ip or \"?\"\n\n    if objtype == \"system\":\n        target = api.find_system(name)\n    else:\n        target = api.find_profile(name)\n\n    # collapse the object down to a rendered datastructure\n    target = utils.blender(api, False, target)\n\n    if target == {}:\n        raise CX(\"failure looking up target\")\n\n    to_addr = settings.build_reporting_email\n    if to_addr == \"\":\n        return 0\n\n    # add the ability to specify an MTA for servers that don't run their own\n    smtp_server = settings.build_reporting_smtp_server\n    if smtp_server == \"\":\n        smtp_server = \"localhost\"\n\n    # use a custom from address or fall back to a reasonable default\n    from_addr = settings.build_reporting_sender\n    if from_addr == \"\":\n        from_addr = \"cobbler@%s\" % settings.server\n\n    subject = settings.build_reporting_subject\n    if subject == \"\":\n        subject = '[Cobbler] install complete '\n\n    to_addr = \",\".join(to_addr)\n    metadata = {\n        \"from_addr\" : from_addr,\n        \"to_addr\"   : to_addr,\n        \"subject\"   : subject,\n        \"boot_ip\"   : boot_ip\n    }\n    metadata.update(target)\n\n    input_template = open(\"/etc/cobbler/reporting/build_report_email.template\")\n    input_data = input_template.read()\n    input_template.close()\n\n    message = templar.Templar(api._config).render(input_data, metadata, None)\n    \n    # for debug, call\n    # print message\n\n    sendmail = True\n    for prefix in settings.build_reporting_ignorelist:\n        if name.lower().startswith(prefix) == True:\n            sendmail = False\n\n    if sendmail == True:\n        # Send the mail\n        # FIXME: on error, return non-zero\n        server_handle = smtplib.SMTP(smtp_server)\n        server_handle.sendmail(from_addr, to_addr.split(','), message)\n        server_handle.quit()\n\n    return 0\n\n\n\n\n", "path": "cobbler/modules/install_post_report.py"}]}