prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  bash_version example doesn't work with json format
  Running `insights run -p examples/rules -f json` results in a traceback because the `bash_version` rule puts an `InstalledRpm` object into its response:
  
  ```
  TypeError: Object of type 'InstalledRpm' is not JSON serializable
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `examples/rules/bash_version.py`
  Content:
  ```
  1 """
  2 Bash Version
  3 ============
  4 
  5 This is a simple rule and can be run against the local host
  6 using the following command::
  7 
  8 $ insights-run -p examples.rules.bash_version
  9 
  10 or from the examples/rules directory::
  11 
  12 $ python sample_rules.py
  13 """
  14 from insights.core.plugins import make_pass, rule
  15 from insights.parsers.installed_rpms import InstalledRpms
  16 
  17 KEY = "BASH_VERSION"
  18 
  19 CONTENT = "Bash RPM Version: {{ bash_version }}"
  20 
  21 
  22 @rule(InstalledRpms)
  23 def report(rpms):
  24     bash_ver = rpms.get_max('bash')
  25     return make_pass(KEY, bash_version=bash_ver)
  26
  ```
  --- 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/examples/rules/bash_version.py b/examples/rules/bash_version.py
  --- a/examples/rules/bash_version.py
  +++ b/examples/rules/bash_version.py
  @@ -11,7 +11,7 @@
   
   $ python sample_rules.py
   """
  -from insights.core.plugins import make_pass, rule
  +from insights.core.plugins import make_info, rule
   from insights.parsers.installed_rpms import InstalledRpms
   
   KEY = "BASH_VERSION"
  @@ -21,5 +21,5 @@
   
   @rule(InstalledRpms)
   def report(rpms):
  -    bash_ver = rpms.get_max('bash')
  -    return make_pass(KEY, bash_version=bash_ver)
  +    bash = rpms.get_max('bash')
  +    return make_info(KEY, bash_version=bash.nvra)
  
verification_info: {"golden_diff": "diff --git a/examples/rules/bash_version.py b/examples/rules/bash_version.py\n--- a/examples/rules/bash_version.py\n+++ b/examples/rules/bash_version.py\n@@ -11,7 +11,7 @@\n \n $ python sample_rules.py\n \"\"\"\n-from insights.core.plugins import make_pass, rule\n+from insights.core.plugins import make_info, rule\n from insights.parsers.installed_rpms import InstalledRpms\n \n KEY = \"BASH_VERSION\"\n@@ -21,5 +21,5 @@\n \n @rule(InstalledRpms)\n def report(rpms):\n-    bash_ver = rpms.get_max('bash')\n-    return make_pass(KEY, bash_version=bash_ver)\n+    bash = rpms.get_max('bash')\n+    return make_info(KEY, bash_version=bash.nvra)\n", "issue": "bash_version example doesn't work with json format\nRunning `insights run -p examples/rules -f json` results in a traceback because the `bash_version` rule puts an `InstalledRpm` object into its response:\r\n\r\n```\r\nTypeError: Object of type 'InstalledRpm' is not JSON serializable\r\n```\n", "before_files": [{"content": "\"\"\"\nBash Version\n============\n\nThis is a simple rule and can be run against the local host\nusing the following command::\n\n$ insights-run -p examples.rules.bash_version\n\nor from the examples/rules directory::\n\n$ python sample_rules.py\n\"\"\"\nfrom insights.core.plugins import make_pass, rule\nfrom insights.parsers.installed_rpms import InstalledRpms\n\nKEY = \"BASH_VERSION\"\n\nCONTENT = \"Bash RPM Version: {{ bash_version }}\"\n\n\n@rule(InstalledRpms)\ndef report(rpms):\n    bash_ver = rpms.get_max('bash')\n    return make_pass(KEY, bash_version=bash_ver)\n", "path": "examples/rules/bash_version.py"}], "after_files": [{"content": "\"\"\"\nBash Version\n============\n\nThis is a simple rule and can be run against the local host\nusing the following command::\n\n$ insights-run -p examples.rules.bash_version\n\nor from the examples/rules directory::\n\n$ python sample_rules.py\n\"\"\"\nfrom insights.core.plugins import make_info, rule\nfrom insights.parsers.installed_rpms import InstalledRpms\n\nKEY = \"BASH_VERSION\"\n\nCONTENT = \"Bash RPM Version: {{ bash_version }}\"\n\n\n@rule(InstalledRpms)\ndef report(rpms):\n    bash = rpms.get_max('bash')\n    return make_info(KEY, bash_version=bash.nvra)\n", "path": "examples/rules/bash_version.py"}]}