public RepoOsEntity getOSEntityForHost(Host host, RepositoryVersionEntity repoVersion) throws SystemException {
    String osFamily = host.getOsFamily();
    RepoOsEntity osEntity = null;
    for (RepoOsEntity operatingSystem : repoVersion.getRepoOsEntities()) {
      if (osFamily.equals(operatingSystem.getFamily())) {
        osEntity = operatingSystem;
        break;
      }
    }

    if (null == osEntity) {
      throw new SystemException(String.format("Operating System matching %s could not be found",
        osFamily));
    }

    return osEntity;
  }
Return repositories available for target os version on host based on {@code repoVersion} repository definition
@param host target {@link Host} for providing repositories list
@param repoVersion {@link RepositoryVersionEntity} version definition with all available repositories

@return {@link RepoOsEntity} with available repositories for host
@throws SystemException if no repository available for target {@link Host}
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/RepositoryVersionHelper.java