prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  RedhatRelease parser failed to parse minor release version in some scenarios
  In few cases where redhat_release content is something similar to below, RedhatRelease parser fails to get the minor version extracted from it
  
  Run:
  ```
  >>> from insights.parsers.redhat_release import RedhatRelease
  >>> from insights.tests import context_wrap
  >>> RedhatRelease(context_wrap("Red Hat Enterprise Linux release 7.5-0.14")).major
  7
  >>> RedhatRelease(context_wrap("Red Hat Enterprise Linux release 7.5-0.14")).minor
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/opt/insights/insights-core/insights/parsers/redhat_release.py", line 59, in minor
      return int(s[1])
  ValueError: invalid literal for int() with base 10: '5-0'
  >>> RedhatRelease(context_wrap("Red Hat Enterprise Linux release 7.5-0.14")).version
  '7.5-0.14'
  ```
  
  </issue>
  <code>
  [start of insights/parsers/redhat_release.py]
  1 """
  2 redhat-release - File ``/etc/redhat-release``
  3 =============================================
  4 
  5 This module provides plugins access to file ``/etc/redhat-release``
  6 
  7 Typical content of file ``/etc/redhat-release`` is::
  8 
  9     Red Hat Enterprise Linux Server release 7.2 (Maipo)
  10 
  11 This module parses the file content and stores data in the dict ``self.parsed``.
  12 The version info can also be get via ``obj.major`` and ``obj.minor``.
  13 Property ``is_rhel`` and ``is_hypervisor`` specifies the host type.
  14 
  15 Examples:
  16     >>> rh_rls_content = '''
  17     ... Red Hat Enterprise Linux Server release 7.2 (Maipo)
  18     ... '''.strip()
  19     >>> from insights.tests import context_wrap
  20     >>> shared = {RedhatRelease: RedhatRelease(context_wrap(rh_rls_content))}
  21     >>> release = shared[RedhatRelease]
  22     >>> assert release.raw == rh_rls_content
  23     >>> assert release.major == 7
  24     >>> assert release.minor == 2
  25     >>> assert release.version == "7.2"
  26     >>> assert release.is_rhel
  27     >>> assert release.product == "Red Hat Enterprise Linux Server"
  28 """
  29 from .. import Parser, parser
  30 from ..specs import Specs
  31 
  32 
  33 @parser(Specs.redhat_release)
  34 class RedhatRelease(Parser):
  35     """Parses the content of file ``/etc/redhat-release``."""
  36 
  37     def parse_content(self, content):
  38         self.raw = content[0]
  39         product, _, version_name = [v.strip() for v in content[0].partition("release")]
  40         version_name_split = [v.strip() for v in version_name.split(None, 1)]
  41         code_name = (version_name_split[1].strip("()")
  42                         if len(version_name_split) > 1 else None)
  43         self.parsed = {
  44             "product": product,
  45             "version": version_name_split[0],
  46             "code_name": code_name
  47         }
  48 
  49     @property
  50     def major(self):
  51         """int: the major version of this OS."""
  52         return int(self.parsed["version"].split(".")[0])
  53 
  54     @property
  55     def minor(self):
  56         """int: the minor version of this OS."""
  57         s = self.parsed["version"].split(".")
  58         if len(s) > 1:
  59             return int(s[1])
  60 
  61     @property
  62     def version(self):
  63         """string: version of this OS."""
  64         return self.parsed["version"]
  65 
  66     @property
  67     def is_rhel(self):
  68         """bool: True if this OS belong to RHEL, else False."""
  69         return "Red Hat Enterprise Linux" in self.parsed["product"]
  70 
  71     @property
  72     def product(self):
  73         """string: product of this OS."""
  74         return self.parsed["product"]
  75
  [end of insights/parsers/redhat_release.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/insights/parsers/redhat_release.py b/insights/parsers/redhat_release.py
  --- a/insights/parsers/redhat_release.py
  +++ b/insights/parsers/redhat_release.py
  @@ -54,7 +54,7 @@
       @property
       def minor(self):
           """int: the minor version of this OS."""
  -        s = self.parsed["version"].split(".")
  +        s = self.parsed["version"].split("-", 1)[0].split(".")
           if len(s) > 1:
               return int(s[1])
  
verification_info: {"golden_diff": "diff --git a/insights/parsers/redhat_release.py b/insights/parsers/redhat_release.py\n--- a/insights/parsers/redhat_release.py\n+++ b/insights/parsers/redhat_release.py\n@@ -54,7 +54,7 @@\n     @property\n     def minor(self):\n         \"\"\"int: the minor version of this OS.\"\"\"\n-        s = self.parsed[\"version\"].split(\".\")\n+        s = self.parsed[\"version\"].split(\"-\", 1)[0].split(\".\")\n         if len(s) > 1:\n             return int(s[1])\n", "issue": "RedhatRelease parser failed to parse minor release version in some scenarios\nIn few cases where redhat_release content is something similar to below, RedhatRelease parser fails to get the minor version extracted from it\r\n\r\nRun:\r\n```\r\n>>> from insights.parsers.redhat_release import RedhatRelease\r\n>>> from insights.tests import context_wrap\r\n>>> RedhatRelease(context_wrap(\"Red Hat Enterprise Linux release 7.5-0.14\")).major\r\n7\r\n>>> RedhatRelease(context_wrap(\"Red Hat Enterprise Linux release 7.5-0.14\")).minor\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/opt/insights/insights-core/insights/parsers/redhat_release.py\", line 59, in minor\r\n    return int(s[1])\r\nValueError: invalid literal for int() with base 10: '5-0'\r\n>>> RedhatRelease(context_wrap(\"Red Hat Enterprise Linux release 7.5-0.14\")).version\r\n'7.5-0.14'\r\n```\n", "before_files": [{"content": "\"\"\"\nredhat-release - File ``/etc/redhat-release``\n=============================================\n\nThis module provides plugins access to file ``/etc/redhat-release``\n\nTypical content of file ``/etc/redhat-release`` is::\n\n    Red Hat Enterprise Linux Server release 7.2 (Maipo)\n\nThis module parses the file content and stores data in the dict ``self.parsed``.\nThe version info can also be get via ``obj.major`` and ``obj.minor``.\nProperty ``is_rhel`` and ``is_hypervisor`` specifies the host type.\n\nExamples:\n    >>> rh_rls_content = '''\n    ... Red Hat Enterprise Linux Server release 7.2 (Maipo)\n    ... '''.strip()\n    >>> from insights.tests import context_wrap\n    >>> shared = {RedhatRelease: RedhatRelease(context_wrap(rh_rls_content))}\n    >>> release = shared[RedhatRelease]\n    >>> assert release.raw == rh_rls_content\n    >>> assert release.major == 7\n    >>> assert release.minor == 2\n    >>> assert release.version == \"7.2\"\n    >>> assert release.is_rhel\n    >>> assert release.product == \"Red Hat Enterprise Linux Server\"\n\"\"\"\nfrom .. import Parser, parser\nfrom ..specs import Specs\n\n\n@parser(Specs.redhat_release)\nclass RedhatRelease(Parser):\n    \"\"\"Parses the content of file ``/etc/redhat-release``.\"\"\"\n\n    def parse_content(self, content):\n        self.raw = content[0]\n        product, _, version_name = [v.strip() for v in content[0].partition(\"release\")]\n        version_name_split = [v.strip() for v in version_name.split(None, 1)]\n        code_name = (version_name_split[1].strip(\"()\")\n                        if len(version_name_split) > 1 else None)\n        self.parsed = {\n            \"product\": product,\n            \"version\": version_name_split[0],\n            \"code_name\": code_name\n        }\n\n    @property\n    def major(self):\n        \"\"\"int: the major version of this OS.\"\"\"\n        return int(self.parsed[\"version\"].split(\".\")[0])\n\n    @property\n    def minor(self):\n        \"\"\"int: the minor version of this OS.\"\"\"\n        s = self.parsed[\"version\"].split(\".\")\n        if len(s) > 1:\n            return int(s[1])\n\n    @property\n    def version(self):\n        \"\"\"string: version of this OS.\"\"\"\n        return self.parsed[\"version\"]\n\n    @property\n    def is_rhel(self):\n        \"\"\"bool: True if this OS belong to RHEL, else False.\"\"\"\n        return \"Red Hat Enterprise Linux\" in self.parsed[\"product\"]\n\n    @property\n    def product(self):\n        \"\"\"string: product of this OS.\"\"\"\n        return self.parsed[\"product\"]\n", "path": "insights/parsers/redhat_release.py"}]}