private boolean updateRepoVersion(StackInfo stackInfo, RepositoryVersionEntity repoVersion) throws Exception {
    ListMultimap<String, RepositoryInfo> serviceReposByOs = stackInfo.getRepositoriesByOs();

    List<RepoOsEntity> operatingSystems = repoVersion.getRepoOsEntities();
    boolean changed = RepoUtil.addServiceReposToOperatingSystemEntities(operatingSystems, serviceReposByOs);
    if (changed) {
      repoVersion.addRepoOsEntities(operatingSystems);
    }
    return changed;
  }
Updates the active {@link RepositoryVersionEntity} for clusters with add-on services defined in management packs.
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/stack/UpdateActiveRepoVersionOnStartup.java