public ExtensionInfo getExtensionByService(String serviceName) {
    Collection<ExtensionInfo> extensions = getExtensions();
    for (ExtensionInfo extension : extensions) {
      Collection<ServiceInfo> services = extension.getServices();
      for (ServiceInfo service : services) {
        if (service.getName().equals(serviceName)) {
          return extension;
        }
      }
    }
    //todo: exception?
    return null;
  }
@return A list containing all repos for this stack, grouped by os
ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java