# -*- coding: utf-8 -*-

"""sysdescrparser.cisco_ios."""


import re
from sysdescr import SysDescr


# pylint: disable=no-member
class JuniperJunos(SysDescr):

    """Class JuniperJunos.

    SNMP sysDescr for Juniper JUNOS.

    """

    def parse(self):
        """Parse."""
        vendor = 'juniper'
        os = 'junos'
        series = self.UNKNOWN
        version = self.UNKNOWN

        regex = (r'Inc. (.*) internet router, kernel JUNOS (.*) #')
        pat = re.compile(regex)
        res = pat.search(self.raw)
        if res:
            series = res.group(1)
            version = res.group(2)

        regex = (r'Inc. (.*) Edge .* Version : \((.*)\) Build')
        pat = re.compile(regex)
        res = pat.search(self.raw)
        if res:
            series = res.group(1)
            version = res.group(2)

        return self._store(vendor, os, series, version)

@@ -403,26 +403,73 @@
  (r'
-Inc. 
+Juniper%5Cs+Networks,%5Cs+Inc.'%0A                 r'%5Cs+
 (.*)
- 
+%5Cs+
 internet
  rou
@@ -468,30 +468,38 @@
 rnet
- 
+%5Cs+
 router,
- 
+%5Cs+
 kernel
- 
+%5Cs+
 JUNOS
- 
+%5Cs+
 (.*)
@@ -679,44 +679,99 @@
  (r'
-Inc. 
+Juniper%5Cs+Networks,%5Cs+Inc.'%0A                 r'%5Cs+
 (.*)
- 
+%5Cs+
 Edge
- .* Version : 
+%5Cs+.*%5Cs+Version%5Cs+:%5Cs+
 %5C((.*)%5C)
  Bui
@@ -766,17 +766,19 @@
 %5C((.*)%5C)
- 
+%5Cs+
 Build')%0A

Change juniper parse regex.