prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [rabbitmq] does not elide password in /etc/rabbitmq.config
  Hi,
  Sosreport as in sos-3.2-36.eo7ost.1.noarch includes in `/etc/rabbitmq/rabbitmq.conf` `default_user` and `default_pass` without being hidden.
  
  Regards,
  Pablo
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `sos/plugins/rabbitmq.py`
  Content:
  ```
  1 # This program is free software; you can redistribute it and/or modify
  2 # it under the terms of the GNU General Public License as published by
  3 # the Free Software Foundation; either version 2 of the License, or
  4 # (at your option) any later version.
  5 
  6 # This program is distributed in the hope that it will be useful,
  7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
  8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  9 # GNU General Public License for more details.
  10 
  11 # You should have received a copy of the GNU General Public License along
  12 # with this program; if not, write to the Free Software Foundation, Inc.,
  13 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  14 
  15 from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
  16 
  17 
  18 class RabbitMQ(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
  19     """RabbitMQ messaging service
  20     """
  21     plugin_name = 'rabbitmq'
  22     profiles = ('services',)
  23     var_puppet_gen = "/var/lib/config-data/puppet-generated/rabbitmq"
  24     files = (
  25         '/etc/rabbitmq/rabbitmq.conf',
  26         var_puppet_gen + '/etc/rabbitmq/rabbitmq.config'
  27     )
  28     packages = ('rabbitmq-server',)
  29 
  30     def setup(self):
  31         container_status = self.get_command_output(
  32             "docker ps -a --format='{{ .Names }}'")
  33 
  34         in_container = False
  35         container_names = []
  36         if container_status['status'] == 0:
  37             for line in container_status['output'].splitlines():
  38                 if line.startswith("rabbitmq"):
  39                     in_container = True
  40                     container_names.append(line)
  41 
  42         if in_container:
  43             for container in container_names:
  44                 self.add_cmd_output('docker logs {0}'.format(container))
  45                 self.add_cmd_output(
  46                     'docker exec -t {0} rabbitmqctl report'
  47                     .format(container)
  48                 )
  49         else:
  50             self.add_cmd_output("rabbitmqctl report")
  51 
  52         self.add_copy_spec([
  53             "/etc/rabbitmq/*",
  54             self.var_puppet_gen + "/etc/rabbitmq/*",
  55             self.var_puppet_gen + "/etc/security/limits.d/",
  56             self.var_puppet_gen + "/etc/systemd/"
  57         ])
  58         self.add_copy_spec([
  59             "/var/log/rabbitmq/*",
  60             "/var/log/containers/rabbitmq/*"
  61         ], sizelimit=self.get_option('log_size'))
  62 
  63 
  64 # vim: set et ts=4 sw=4 :
  65
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/sos/plugins/rabbitmq.py b/sos/plugins/rabbitmq.py
  --- a/sos/plugins/rabbitmq.py
  +++ b/sos/plugins/rabbitmq.py
  @@ -60,5 +60,8 @@
               "/var/log/containers/rabbitmq/*"
           ], sizelimit=self.get_option('log_size'))
   
  +    def postproc(self):
  +        self.do_file_sub("/etc/rabbitmq/rabbitmq.conf",
  +                         r"(\s*default_pass\s*,\s*)\S+", r"\1<<***>>},")
   
   # vim: set et ts=4 sw=4 :
  
verification_info: {"golden_diff": "diff --git a/sos/plugins/rabbitmq.py b/sos/plugins/rabbitmq.py\n--- a/sos/plugins/rabbitmq.py\n+++ b/sos/plugins/rabbitmq.py\n@@ -60,5 +60,8 @@\n             \"/var/log/containers/rabbitmq/*\"\n         ], sizelimit=self.get_option('log_size'))\n \n+    def postproc(self):\n+        self.do_file_sub(\"/etc/rabbitmq/rabbitmq.conf\",\n+                         r\"(\\s*default_pass\\s*,\\s*)\\S+\", r\"\\1<<***>>},\")\n \n # vim: set et ts=4 sw=4 :\n", "issue": "[rabbitmq] does not elide password in /etc/rabbitmq.config\nHi,\nSosreport as in sos-3.2-36.eo7ost.1.noarch includes in `/etc/rabbitmq/rabbitmq.conf` `default_user` and `default_pass` without being hidden.\n\nRegards,\nPablo\n\n", "before_files": [{"content": "# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License along\n# with this program; if not, write to the Free Software Foundation, Inc.,\n# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\nfrom sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin\n\n\nclass RabbitMQ(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):\n    \"\"\"RabbitMQ messaging service\n    \"\"\"\n    plugin_name = 'rabbitmq'\n    profiles = ('services',)\n    var_puppet_gen = \"/var/lib/config-data/puppet-generated/rabbitmq\"\n    files = (\n        '/etc/rabbitmq/rabbitmq.conf',\n        var_puppet_gen + '/etc/rabbitmq/rabbitmq.config'\n    )\n    packages = ('rabbitmq-server',)\n\n    def setup(self):\n        container_status = self.get_command_output(\n            \"docker ps -a --format='{{ .Names }}'\")\n\n        in_container = False\n        container_names = []\n        if container_status['status'] == 0:\n            for line in container_status['output'].splitlines():\n                if line.startswith(\"rabbitmq\"):\n                    in_container = True\n                    container_names.append(line)\n\n        if in_container:\n            for container in container_names:\n                self.add_cmd_output('docker logs {0}'.format(container))\n                self.add_cmd_output(\n                    'docker exec -t {0} rabbitmqctl report'\n                    .format(container)\n                )\n        else:\n            self.add_cmd_output(\"rabbitmqctl report\")\n\n        self.add_copy_spec([\n            \"/etc/rabbitmq/*\",\n            self.var_puppet_gen + \"/etc/rabbitmq/*\",\n            self.var_puppet_gen + \"/etc/security/limits.d/\",\n            self.var_puppet_gen + \"/etc/systemd/\"\n        ])\n        self.add_copy_spec([\n            \"/var/log/rabbitmq/*\",\n            \"/var/log/containers/rabbitmq/*\"\n        ], sizelimit=self.get_option('log_size'))\n\n\n# vim: set et ts=4 sw=4 :\n", "path": "sos/plugins/rabbitmq.py"}], "after_files": [{"content": "# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License along\n# with this program; if not, write to the Free Software Foundation, Inc.,\n# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\nfrom sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin\n\n\nclass RabbitMQ(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):\n    \"\"\"RabbitMQ messaging service\n    \"\"\"\n    plugin_name = 'rabbitmq'\n    profiles = ('services',)\n    var_puppet_gen = \"/var/lib/config-data/puppet-generated/rabbitmq\"\n    files = (\n        '/etc/rabbitmq/rabbitmq.conf',\n        var_puppet_gen + '/etc/rabbitmq/rabbitmq.config'\n    )\n    packages = ('rabbitmq-server',)\n\n    def setup(self):\n        container_status = self.get_command_output(\n            \"docker ps -a --format='{{ .Names }}'\")\n\n        in_container = False\n        container_names = []\n        if container_status['status'] == 0:\n            for line in container_status['output'].splitlines():\n                if line.startswith(\"rabbitmq\"):\n                    in_container = True\n                    container_names.append(line)\n\n        if in_container:\n            for container in container_names:\n                self.add_cmd_output('docker logs {0}'.format(container))\n                self.add_cmd_output(\n                    'docker exec -t {0} rabbitmqctl report'\n                    .format(container)\n                )\n        else:\n            self.add_cmd_output(\"rabbitmqctl report\")\n\n        self.add_copy_spec([\n            \"/etc/rabbitmq/*\",\n            self.var_puppet_gen + \"/etc/rabbitmq/*\",\n            self.var_puppet_gen + \"/etc/security/limits.d/\",\n            self.var_puppet_gen + \"/etc/systemd/\"\n        ])\n        self.add_copy_spec([\n            \"/var/log/rabbitmq/*\",\n            \"/var/log/containers/rabbitmq/*\"\n        ], sizelimit=self.get_option('log_size'))\n\n    def postproc(self):\n        self.do_file_sub(\"/etc/rabbitmq/rabbitmq.conf\",\n                         r\"(\\s*default_pass\\s*,\\s*)\\S+\", r\"\\1<<***>>},\")\n\n# vim: set et ts=4 sw=4 :\n", "path": "sos/plugins/rabbitmq.py"}]}