private Map<String,String> parse_os(String os){
      Map<String,String> pos = new HashMap<>();

      Pattern r = Pattern.compile(os_pattern);
      Matcher m = r.matcher(os);

      if (m.matches()) {
        pos.put(OS_DISTRO, m.group(1));
        pos.put(OS_VERSION, m.group(2));
      } else {
        pos.put(OS_DISTRO, os);
        pos.put(OS_VERSION, "");
      }
      return pos;
    }
Separate os name from os major version
@param os the os
@return separated os name and os version
ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java