Bug 1427238 - cdn-sync: support syncing not-mapped CDN repositories into custom channel
Summary: cdn-sync: support syncing not-mapped CDN repositories into custom channel
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Satellite Synchronization
Version: 580
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Dobes
QA Contact: Pavel Studeník
URL:
Whiteboard:
Depends On:
Blocks: 1340444
TreeView+ depends on / blocked
 
Reported: 2017-02-27 16:25 UTC by Jan Dobes
Modified: 2017-06-21 12:08 UTC (History)
4 users (show)

Fixed In Version: spacewalk-backend-2.5.3-132
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-21 12:08:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Dobes 2017-02-27 16:25:07 UTC
Description of problem:
cdn-sync relies on cdn-sync-mappings package which provides information which channels are available and which CDN repositories are mapped to these channels. However, there might be repositories which customer could access with his SSL certificate but they are not mapped to any channel. In this case customer could setup custom channel and CDN repositories manually and sync them using spacewalk-repo-sync.

There should be possible to sync similar unmapped repositories into custom channel using cdn-sync.


Actual results:
not-mapped repositories are not possible to sync officially 

Expected results:
not-mapped repositories is possible to sync using cdn-sync into custom channel

Comment 1 Jan Dobes 2017-03-14 15:41:15 UTC
fixed in spacewalk master:

2f6327ba8b098a74d4d54493d5fb2b0fce947b2b
8848be39a28516cf448197915d5c41fc8a18b70e
bf1e650df3871a47ef7cd4d58488917e72cbc76b
a56d904153c3a905f3260b5cb0a18877a6e04ca8
720792906de037405ede6c0f47c04b43c8519493
cd19309ee3a862539ece636037d5a69cbb70686e
154c7fb7456aee9035c0896bc8d6928ff2ac79f2
b3e9fcf393bc2c14ccbd59b5990a1a920ccc9ddb
d4613e3e9231332b01fbdcbe397fd5296512431b
7580fd49369d40e417fa95419e91feac27d1915b
05aedb0d56f50089a483ca05e1848601954917c4
b1871e2fe707015264b331a0e631e801a923bcf1
0a70ef6287e8709e9de77a2b502d1a5a24be5428
127e343a0b499253d02a6fe98ae0f7fe05a7c7a6
fb27dda744f10475ca19dfd906191df0d7b6bf4f
7c9ac63a6bfbf64a90d3cfd3ef06ae1836914320
873ec69f7f8dacd0950054a7647fff6fa80407cf
a74c46f2c6ed1ff0ea3e5642068dcd7e919f43c4
1bb6fef11e5cbf6b5283b312a6fc6cedcf95f07c
8d99d6c586842e4f33519c860e48a08b23253a2f
021baae3f10e942b00f726e6434b7d0f522a4090
a9badd4791fa6616d171f12e14cfff0b564b37b9
e169f31abb63fa64060658fa2ceff51e4624a64d
33720a43a004f5dcdf039fd7ff9e540c2cbaa79b
d12cfbd09a7b327c53159f2681ff2a7e77baaa50

+ one spacewalk specific stops requiring cdn-sync-mappings installed
a1515951e61662a0601b523e403afa915a670a2e

Comment 4 Pavel Studeník 2017-05-16 12:27:22 UTC
I show repository by "cdn-sync -rl" and I try to sync it to custom channel.

15:21:51     . rhn-tools-rhel-x86_64-workstation-7                       103 packages   (21.7M)
15:21:51         /content/dist/rhel/workstation/7/7Workstation/x86_64/rhn-tools/os

>> cdn-sync -c my-workstation -a /content/dist/rhel/workstation/7/7Workstation/x86_64/rhn-tools/os
15:22:15 ERROR: Specified repositories can't be synced because they are part of following channels: rhn-tools-rhel-x86_64-workstation-7
ERROR: custom CDN repository sync failed: 
Unable to attach requested repositories to this channel.

URL has to end with slash "/", but it is shown without slash in list of repositories.

Following command works correct (with slash):

>> cdn-sync -c my-workstation -a /content/dist/rhel/workstation/7/7Workstation/x86_64/rhn-tools/os/

I suppose that it can be confusing for users.

Comment 5 Jan Dobes 2017-05-16 13:47:37 UTC
(In reply to Pavel Studeník from comment #4)
> I show repository by "cdn-sync -rl" and I try to sync it to custom channel.
> 
> 15:21:51     . rhn-tools-rhel-x86_64-workstation-7                       103
> packages   (21.7M)
> 15:21:51        
> /content/dist/rhel/workstation/7/7Workstation/x86_64/rhn-tools/os
> 
> >> cdn-sync -c my-workstation -a /content/dist/rhel/workstation/7/7Workstation/x86_64/rhn-tools/os
> 15:22:15 ERROR: Specified repositories can't be synced because they are part
> of following channels: rhn-tools-rhel-x86_64-workstation-7
> ERROR: custom CDN repository sync failed: 
> Unable to attach requested repositories to this channel.

This is correct because you can't sync repository into custom channel if the repository is connected to Red Hat channel.

> 
> URL has to end with slash "/", but it is shown without slash in list of
> repositories.
> 
> Following command works correct (with slash):
> 
> >> cdn-sync -c my-workstation -a /content/dist/rhel/workstation/7/7Workstation/x86_64/rhn-tools/os/

This is not correct and should be fixed. Behavior should be same as in first case - this can't be synced.

> 
> I suppose that it can be confusing for users.

Comment 6 Pavel Studeník 2017-05-16 15:06:59 UTC
Ok. In this case, it can be url define with "." or "..", for example

>> cdn-sync -c my-rhel-x86_64-ost-11-tools-workstation -a /content/dist/rhel/workstation/7/7Workstation/x86_64/openstack-tools/11/os/../os/

>> ... openstack-tools/11/os/.
>> ... openstack-tools/11/os/./


it causes error:
...
  File "/usr/lib/python2.6/site-packages/spacewalk/cdn_tools/repository.py", line 372, in _browse_node
    to_check = [x for x in node.keys() if x in self.VARIABLES or x == step]
Exception: SYNC ERROR: attempting to display as much information as possible
 'CdnRepository' object has no attribute 'keys

Comment 7 Jan Dobes 2017-05-17 15:13:46 UTC
fixed in spacewalk master:

96494862bc8b0c9790ae9ccb5609052aea19b19f
b2573af778857a19a40ddef1aa884a94a001e3ee
63e51ffdd032134bfafe3b70633a3b2977ca7627

traceback is fixed, it now supports "." and ".." in path and it will not allow to sync repository paths obfuscated this way if they point to repository connected to RH channel

Comment 11 Pavel Studeník 2017-05-31 10:15:20 UTC
Reproducer:

Add satellite6 repository (it doesn't contain in rhn, only in cdn)

>> cdn-sync -d /content/dist/rhel/server/6/6Server/x86_64/satellite/6.2/os -c satellite6

Verified with spacewalk-backend-cdn-2.5.3-137.el6sat.noarch


Note You need to log in before you can comment on or make changes to this bug.