Skip to content

Commit

Permalink
Merge pull request #9230 from mcalmer/enable-deb-for-payg
Browse files Browse the repository at this point in the history
Enable deb for payg
  • Loading branch information
deneb-alpha authored Sep 24, 2024
2 parents a49ad32 + ca54083 commit 5b5f623
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@
import com.redhat.rhn.common.util.RpmVersionComparator;
import com.redhat.rhn.domain.channel.ChannelFamily;
import com.redhat.rhn.domain.channel.ChannelFamilyFactory;
import com.redhat.rhn.domain.common.ArchType;
import com.redhat.rhn.domain.credentials.CloudCredentials;
import com.redhat.rhn.domain.credentials.CloudRMTCredentials;
import com.redhat.rhn.domain.credentials.RemoteCredentials;
import com.redhat.rhn.domain.product.SUSEProduct;
import com.redhat.rhn.domain.product.SUSEProductFactory;
import com.redhat.rhn.domain.rhnpackage.PackageFactory;
import com.redhat.rhn.domain.scc.SCCCachingFactory;
import com.redhat.rhn.domain.scc.SCCRepository;
import com.redhat.rhn.domain.scc.SCCRepositoryAuth;
Expand Down Expand Up @@ -174,11 +172,8 @@ public static List<PaygProductInfo> listAdditionalProductsForSUMAPayg() {

private static boolean isSupportedToolsProduct(SUSEProduct product) {
ChannelFamily family = product.getChannelFamily();
ArchType architecture = product.getArch().getArchType();

return ChannelFamilyFactory.TOOLS_CHANNEL_FAMILY_LABEL.equals(family.getLabel()) &&
// TODO: deb not yet available on RMT
PackageFactory.ARCH_TYPE_RPM.equals(architecture.getLabel());
return ChannelFamilyFactory.TOOLS_CHANNEL_FAMILY_LABEL.equals(family.getLabel());
}

private static boolean isSupportedProxyProduct(SUSEProduct product) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1620,15 +1620,7 @@ private List<ProductTreeEntry> loadStaticTree(String tag) throws ContentSyncExce
return sources.stream().map(source -> {
try {
SCCClient scc = getSCCClient(source);
var tree1 = scc.productTree();
// Non rpm client tools are not available in cloud rmt so we remove these products.
if (sources.stream().allMatch(c -> c instanceof RMTContentSyncSource)) {
// Remove Ubuntu and Debian products until RMT supports them
tree1.removeIf(product -> product.getChannelLabel().contains("amd64") ||
product.getParentChannelLabel().filter(label -> label.contains("amd64")).isPresent()
);
}
return tree1;
return scc.productTree();
}
catch (SCCClientException e) {
throw new ContentSyncException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,8 @@ public void testRefreshPayg() throws Exception {
() -> assertContains(noAuthRepos, "oraclelinux9"),
() -> assertContains(noAuthRepos, "almalinux8"),
() -> assertContains(noAuthRepos, "almalinux9"),
// Ubuntu and Debian should be excluded until RMT supports them
() -> assertNotContains(noAuthRepos, "debian-11-pool"),
() -> assertNotContains(noAuthRepos, "ubuntu-2204-amd64-main")
() -> assertContains(noAuthRepos, "debian-11-pool"),
() -> assertContains(noAuthRepos, "ubuntu-2204-amd64-main")
);
}
finally {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- remove restrictions for debian repositories in public cloud
2 changes: 2 additions & 0 deletions python/spacewalk/satellite_tools/repo_plugins/deb_src.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def _download(self, url):
cert=(self.sslclientcert, self.sslclientkey),
verify=self.sslcacert,
timeout=self.timeout,
headers=self.http_headers,
)
if not data.ok:
return ""
Expand Down Expand Up @@ -425,6 +426,7 @@ def __init__(
channel_label=channel_label,
timeout=self.timeout,
)
self.repo.http_headers = http_headers
self.repo.verify()

self.num_packages = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- provide http_headers also to debian repository syncer

0 comments on commit 5b5f623

Please sign in to comment.