Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-10609

The MIB Compiler is unable to parse certain MIBs

    XMLWordPrintable

    Details

      Description

      I was requested to compile a bunch of MIBs, and the Vaadin UI was complaining about some of them. It was even complaining about dependencies that were already present on the system.

      For this reason, I've created a low level JUnit test to figure out what's wrong, and I found a problem on the JsmiMibParser. There was a mistake on the main loop that was never triggered by all the tests that were already there, but I was able to trigger it with the new MIBs I'm trying to compile right now.

      That was preventing to finish all the processing, leading to showing dependencies issues for MIBs that were already compiled.

      Fortunately, the fix is very easy:

      diff --git a/features/mib-compiler/src/main/java/org/opennms/features/mibcompiler/services/JsmiMibParser.java b/features/mib-compiler/src/main/java/org/opennms/features/mibcompiler/services/JsmiMibParser.java
      index 986017d7ec8..4855eded025 100644
      --- a/features/mib-compiler/src/main/java/org/opennms/features/mibcompiler/services/JsmiMibParser.java
      +++ b/features/mib-compiler/src/main/java/org/opennms/features/mibcompiler/services/JsmiMibParser.java
      @@ -159,7 +159,6 @@ public class JsmiMibParser implements MibParser, Serializable {
                   } catch (Exception e) {
                       LOG.error("Can't compile {}", mibFile, e);
                       errorHandler.addError(e.getMessage());
      -                return false;
                   }
                   if (errorHandler.isOk()) {
                       break;
      

      After applying that fix, I was able to parse the new MIBs. All the existing tests are still passing.

       

        Attachments

        1. image001.png
          5 kB
          Alejandro Galue

          Activity

            People

            • Assignee:
              agalue Alejandro Galue
              Reporter:
              agalue Alejandro Galue
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: