public void addCommandRepositoryToContext(ActionExecutionContext context,
      final RepositoryVersionEntity repoVersion, RepoOsEntity osEntity) throws SystemException {

    final CommandRepository commandRepo = getCommandRepository(repoVersion, osEntity);

    ClusterVersionSummary summary = null;

    if (RepositoryType.STANDARD != repoVersion.getType()) {
      try {
        final Cluster cluster = clusters.get().getCluster(context.getClusterName());

        VersionDefinitionXml xml = repoVersion.getRepositoryXml();
        summary = xml.getClusterSummary(cluster, ami.get());
      } catch (Exception e) {
        LOG.warn("Could not determine repository from %s/%s.  Will not pass cluster version.");
      }
    }

    final ClusterVersionSummary clusterSummary = summary;

    context.addVisitor(command -> {
      if (null == command.getRepositoryFile()) {
        command.setRepositoryFile(commandRepo);
      }

      if (null != clusterSummary) {
        Map<String, Object> params = command.getRoleParameters();
        if (null == params) {
          params = new HashMap<>();
          command.setRoleParameters(params);
        }
        params.put(KeyNames.CLUSTER_VERSION_SUMMARY, clusterSummary);
      }

    });
  }
Adds a command repository to the action context
@param context       the context
@param osEntity      the OS family
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/RepositoryVersionHelper.java