prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Some MAAS config files missing from collection
  Currently we're only collecting `/var/lib/maas/dhcp`, meaning that we're missing other key config files that would help with troubleshooting MAAS issues, e.g.,  `/var/lib/maas/http`. I'd suggest to add the below paths to be collected:
  
  * /var/lib/maas/http/*
  * /var/lib/maas/*.conf
  
  </issue>
  <code>
  [start of sos/report/plugins/maas.py]
  1 # Copyright (C) 2013 Adam Stokes <adam.stokes@ubuntu.com>
  2 #
  3 # This file is part of the sos project: https://github.com/sosreport/sos
  4 #
  5 # This copyrighted material is made available to anyone wishing to use,
  6 # modify, copy, or redistribute it subject to the terms and conditions of
  7 # version 2 of the GNU General Public License.
  8 #
  9 # See the LICENSE file in the source distribution for further information.
  10 
  11 from sos.report.plugins import Plugin, UbuntuPlugin, PluginOpt
  12 
  13 
  14 class Maas(Plugin, UbuntuPlugin):
  15 
  16     short_desc = 'Ubuntu Metal-As-A-Service'
  17 
  18     plugin_name = 'maas'
  19     profiles = ('sysmgmt',)
  20     packages = ('maas', 'maas-common')
  21 
  22     services = (
  23         # For the deb:
  24         'maas-dhcpd',
  25         'maas-dhcpd6',
  26         'maas-http',
  27         'maas-proxy',
  28         'maas-rackd',
  29         'maas-regiond',
  30         'maas-syslog',
  31         # For the snap:
  32         'snap.maas.supervisor',
  33     )
  34 
  35     option_list = [
  36         PluginOpt('profile-name', default='', val_type=str,
  37                   desc='Name of the remote API'),
  38         PluginOpt('url', default='', val_type=str,
  39                   desc='URL of the remote API'),
  40         PluginOpt('credentials', default='', val_type=str,
  41                   desc='Credentials, or the API key')
  42     ]
  43 
  44     def _has_login_options(self):
  45         return self.get_option("url") and self.get_option("credentials") \
  46             and self.get_option("profile-name")
  47 
  48     def _remote_api_login(self):
  49         ret = self.exec_cmd(
  50             "maas login %s %s %s" % (
  51                 self.get_option("profile-name"),
  52                 self.get_option("url"),
  53                 self.get_option("credentials")
  54             )
  55         )
  56 
  57         return ret['status'] == 0
  58 
  59     def _is_snap_installed(self):
  60         maas_pkg = self.policy.package_manager.pkg_by_name('maas')
  61         if maas_pkg:
  62             return maas_pkg['pkg_manager'] == 'snap'
  63         return False
  64 
  65     def setup(self):
  66         self._is_snap = self._is_snap_installed()
  67         if self._is_snap:
  68             self.add_cmd_output([
  69                 'snap info maas',
  70                 'maas status'
  71             ])
  72             # Don't send secrets
  73             self.add_forbidden_path("/var/snap/maas/current/bind/session.key")
  74             self.add_copy_spec([
  75                 "/var/snap/maas/common/log",
  76                 "/var/snap/maas/common/snap_mode",
  77                 "/var/snap/maas/current/*.conf",
  78                 "/var/snap/maas/current/bind",
  79                 "/var/snap/maas/current/http",
  80                 "/var/snap/maas/current/supervisord",
  81                 "/var/snap/maas/current/preseeds",
  82                 "/var/snap/maas/current/proxy",
  83                 "/var/snap/maas/current/rsyslog",
  84             ])
  85         else:
  86             self.add_copy_spec([
  87                 "/etc/squid-deb-proxy",
  88                 "/etc/maas",
  89                 "/var/lib/maas/dhcp*",
  90                 "/var/log/apache2*",
  91                 "/var/log/maas*",
  92                 "/var/log/upstart/maas-*",
  93             ])
  94             self.add_cmd_output([
  95                 "apt-cache policy maas-*",
  96                 "apt-cache policy python-django-*",
  97             ])
  98 
  99         if self.is_installed("maas-region-controller"):
  100             self.add_cmd_output([
  101                 "maas-region dumpdata",
  102             ])
  103 
  104         if self._has_login_options():
  105             if self._remote_api_login():
  106                 self.add_cmd_output("maas %s commissioning-results list" %
  107                                     self.get_option("profile-name"))
  108             else:
  109                 self._log_error(
  110                     "Cannot login into MAAS remote API with provided creds.")
  111 
  112     def postproc(self):
  113         if self._is_snap:
  114             regiond_path = "/var/snap/maas/current/maas/regiond.conf"
  115         else:
  116             regiond_path = "/etc/maas/regiond.conf"
  117         self.do_file_sub(regiond_path,
  118                          r"(database_pass\s*:\s*)(.*)",
  119                          r"\1********")
  120 
  121 # vim: set et ts=4 sw=4 :
  122
  [end of sos/report/plugins/maas.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/sos/report/plugins/maas.py b/sos/report/plugins/maas.py
  --- a/sos/report/plugins/maas.py
  +++ b/sos/report/plugins/maas.py
  @@ -87,6 +87,9 @@
                   "/etc/squid-deb-proxy",
                   "/etc/maas",
                   "/var/lib/maas/dhcp*",
  +                "/var/lib/maas/http/*.conf",
  +                "/var/lib/maas/*.conf",
  +                "/var/lib/maas/rsyslog",
                   "/var/log/apache2*",
                   "/var/log/maas*",
                   "/var/log/upstart/maas-*",
  
verification_info: {"golden_diff": "diff --git a/sos/report/plugins/maas.py b/sos/report/plugins/maas.py\n--- a/sos/report/plugins/maas.py\n+++ b/sos/report/plugins/maas.py\n@@ -87,6 +87,9 @@\n                 \"/etc/squid-deb-proxy\",\n                 \"/etc/maas\",\n                 \"/var/lib/maas/dhcp*\",\n+                \"/var/lib/maas/http/*.conf\",\n+                \"/var/lib/maas/*.conf\",\n+                \"/var/lib/maas/rsyslog\",\n                 \"/var/log/apache2*\",\n                 \"/var/log/maas*\",\n                 \"/var/log/upstart/maas-*\",\n", "issue": "Some MAAS config files missing from collection\nCurrently we're only collecting `/var/lib/maas/dhcp`, meaning that we're missing other key config files that would help with troubleshooting MAAS issues, e.g.,  `/var/lib/maas/http`. I'd suggest to add the below paths to be collected:\r\n\r\n* /var/lib/maas/http/*\r\n* /var/lib/maas/*.conf\n", "before_files": [{"content": "# Copyright (C) 2013 Adam Stokes <adam.stokes@ubuntu.com>\n#\n# This file is part of the sos project: https://github.com/sosreport/sos\n#\n# This copyrighted material is made available to anyone wishing to use,\n# modify, copy, or redistribute it subject to the terms and conditions of\n# version 2 of the GNU General Public License.\n#\n# See the LICENSE file in the source distribution for further information.\n\nfrom sos.report.plugins import Plugin, UbuntuPlugin, PluginOpt\n\n\nclass Maas(Plugin, UbuntuPlugin):\n\n    short_desc = 'Ubuntu Metal-As-A-Service'\n\n    plugin_name = 'maas'\n    profiles = ('sysmgmt',)\n    packages = ('maas', 'maas-common')\n\n    services = (\n        # For the deb:\n        'maas-dhcpd',\n        'maas-dhcpd6',\n        'maas-http',\n        'maas-proxy',\n        'maas-rackd',\n        'maas-regiond',\n        'maas-syslog',\n        # For the snap:\n        'snap.maas.supervisor',\n    )\n\n    option_list = [\n        PluginOpt('profile-name', default='', val_type=str,\n                  desc='Name of the remote API'),\n        PluginOpt('url', default='', val_type=str,\n                  desc='URL of the remote API'),\n        PluginOpt('credentials', default='', val_type=str,\n                  desc='Credentials, or the API key')\n    ]\n\n    def _has_login_options(self):\n        return self.get_option(\"url\") and self.get_option(\"credentials\") \\\n            and self.get_option(\"profile-name\")\n\n    def _remote_api_login(self):\n        ret = self.exec_cmd(\n            \"maas login %s %s %s\" % (\n                self.get_option(\"profile-name\"),\n                self.get_option(\"url\"),\n                self.get_option(\"credentials\")\n            )\n        )\n\n        return ret['status'] == 0\n\n    def _is_snap_installed(self):\n        maas_pkg = self.policy.package_manager.pkg_by_name('maas')\n        if maas_pkg:\n            return maas_pkg['pkg_manager'] == 'snap'\n        return False\n\n    def setup(self):\n        self._is_snap = self._is_snap_installed()\n        if self._is_snap:\n            self.add_cmd_output([\n                'snap info maas',\n                'maas status'\n            ])\n            # Don't send secrets\n            self.add_forbidden_path(\"/var/snap/maas/current/bind/session.key\")\n            self.add_copy_spec([\n                \"/var/snap/maas/common/log\",\n                \"/var/snap/maas/common/snap_mode\",\n                \"/var/snap/maas/current/*.conf\",\n                \"/var/snap/maas/current/bind\",\n                \"/var/snap/maas/current/http\",\n                \"/var/snap/maas/current/supervisord\",\n                \"/var/snap/maas/current/preseeds\",\n                \"/var/snap/maas/current/proxy\",\n                \"/var/snap/maas/current/rsyslog\",\n            ])\n        else:\n            self.add_copy_spec([\n                \"/etc/squid-deb-proxy\",\n                \"/etc/maas\",\n                \"/var/lib/maas/dhcp*\",\n                \"/var/log/apache2*\",\n                \"/var/log/maas*\",\n                \"/var/log/upstart/maas-*\",\n            ])\n            self.add_cmd_output([\n                \"apt-cache policy maas-*\",\n                \"apt-cache policy python-django-*\",\n            ])\n\n        if self.is_installed(\"maas-region-controller\"):\n            self.add_cmd_output([\n                \"maas-region dumpdata\",\n            ])\n\n        if self._has_login_options():\n            if self._remote_api_login():\n                self.add_cmd_output(\"maas %s commissioning-results list\" %\n                                    self.get_option(\"profile-name\"))\n            else:\n                self._log_error(\n                    \"Cannot login into MAAS remote API with provided creds.\")\n\n    def postproc(self):\n        if self._is_snap:\n            regiond_path = \"/var/snap/maas/current/maas/regiond.conf\"\n        else:\n            regiond_path = \"/etc/maas/regiond.conf\"\n        self.do_file_sub(regiond_path,\n                         r\"(database_pass\\s*:\\s*)(.*)\",\n                         r\"\\1********\")\n\n# vim: set et ts=4 sw=4 :\n", "path": "sos/report/plugins/maas.py"}]}