prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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
  ```
  
  </issue>
  <code>
  [start of examples/rules/bash_version.py]
  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 of examples/rules/bash_version.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/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"}]}