Bug 1387173 - spacewalk-repo-sync does not respect /etc/rhn/spacewalk-repo-sync/yum.conf
Summary: spacewalk-repo-sync does not respect /etc/rhn/spacewalk-repo-sync/yum.conf
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Satellite Synchronization
Version: 580
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Jan Dobes
QA Contact: Jan Hutař
URL:
Whiteboard:
Depends On:
Blocks: 1340444
TreeView+ depends on / blocked
 
Reported: 2016-10-20 10:06 UTC by Jan Hutař
Modified: 2017-06-21 12:18 UTC (History)
6 users (show)

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


Attachments (Terms of Use)

Description Jan Hutař 2016-10-20 10:06:23 UTC
Description of problem:
Looks like spacewalk-repo-sync do not respect /etc/rhn/spacewalk-repo-sync/yum.conf. Seen the problem on 5.8.0, and verified on Spacewalk nightly.


Version-Release number of selected component (if applicable):
Yesterdays 5.8.0 compose or so.
Also seen on Spacewalk: spacewalk-backend-tools-2.6.63-1.el6.noarch


How reproducible:
always


Steps to Reproduce:
1. Create repository:
     Name: spacewalk-repo-sync-local-config
     Url: http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64/
     Type: yum
2. Create base custom channel "spacewalk-repo-sync-local-config" (x86_64 arch)
   and assign the repository to it
3. Configure this (note that repo is not gpg-signed):
   # cat /etc/rhn/spacewalk-repo-sync/yum.conf 
   [main]
   
   [spacewalk-repo-sync-local-config]
   name=spacewalk-repo-sync-local-config
   repo_gpgcheck=1
4. # spacewalk-repo-sync -c spacewalk-repo-sync-local-config


Actual results:
On SWnightly (spacewalk-backend-tools-2.6.63-1.el6.noarch) this is the output (ignore small "total time" - I had it already synced there before so IMO packages were cached):

# spacewalk-repo-sync -c spacewalk-repo-sync-local-config
11:57:23 ======================================
11:57:23 | Channel: spacewalk-repo-sync-local-config
11:57:23 ======================================
11:57:23 Sync of channel started.
11:57:24 Repo URL: http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64/
11:57:24 Packages in repo:                25
11:57:24 Packages already synced:          0
11:57:24 Packages to sync:                25
11:57:24 1/25 : osa-common-5.11.73-1.el7.noarch
[...]
11:57:24 25/25 : yum-rhn-plugin-2.6.1-1.el7.noarch
11:57:24 Linking packages to channel.
11:57:24 Repo http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64/ has comps file comps-spacewalk-client-rhel7.xml.
11:57:24 Repo http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64/ has 0 errata.
11:57:24 Sync of channel completed in 0:00:00.
11:57:24 Total time: 0:00:00


Expected results:
On Satellite 5.7.0 (spacewalk-backend-tools-2.3.3-43.el6sat.noarch) with same setup:

# spacewalk-repo-sync -c spacewalk-repo-sync-local-config
#### Channel label: spacewalk-repo-sync-local-config ####
Repo URL: http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64/
ERROR: Cannot retrieve repository metadata (repomd.xml) for repository: spacewalk-repo-sync-local-config. Please verify its path and try again
Sync completed.
Total time: 0:00:01

Comment 2 Gennadii Altukhov 2016-11-10 18:01:46 UTC
Taking ...

Comment 3 Jan Dobes 2016-11-28 16:47:08 UTC
fixed in spacewalk master:

b826ddad704b9f29cebe0e08a7d7266434dc5135
e344983c4222483daf545a989d8deab22e1d96b9
2c3cece68bd1cc4a98874a4debe63ce6881fee6a

Comment 4 Jan Dobes 2016-11-28 16:50:25 UTC
I found out spacewalk-repo-sync takes the configuration not only from /etc/rhn/spacewalk-repo-sync/yum.conf but also from /etc/yum.repos.d/* (and possibly from other locations) if the label of repo/channel matches. I think it's also on Satellite 5.7. Is this expected?

Comment 5 Jan Dobes 2016-11-30 15:22:52 UTC
adding additional fix to not allow vendor channels/repos in null org to be configured

sw master:
32d493c180855e2b4e4f8079b5c8b8633083ad22

Comment 7 Jan Hutař 2016-12-15 13:47:36 UTC
(In reply to Jan Dobes from comment #4)
> I found out spacewalk-repo-sync takes the configuration not only from
> /etc/rhn/spacewalk-repo-sync/yum.conf but also from /etc/yum.repos.d/* (and
> possibly from other locations) if the label of repo/channel matches. I think
> it's also on Satellite 5.7. Is this expected?

Sorry for this long reply time.

Tested on Satellite 5.7 and yes, it accepts config from /etc/yum.repos.d/* as well:


# rpm -qf `type -p spacewalk-repo-sync`
spacewalk-backend-tools-2.3.3-45.el6sat.noarch
# cat /etc/rhn/spacewalk-repo-sync/yum.conf
[main]
# cat /etc/yum.repos.d/bz1387173.repo
[bz1387173]
name=bz1387173
repo_gpgcheck=1
gpgcheck=0
baseurl=http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64/
enabled=0
# spacewalk-repo-sync -c bz1387173
#### Channel label: bz1387173 ####
Repo URL: http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64//
ERROR: Cannot retrieve repository metadata (repomd.xml) for repository: bz1387173. Please verify its path and try again
Sync completed.
Total time: 0:00:01


When I comment-out "repo_gpgcheck=1", it worked:


# cat /etc/yum.repos.d/bz1387173.repo
[bz1387173]
name=bz1387173
###repo_gpgcheck=1
gpgcheck=0
baseurl=http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64/
enabled=0
# spacewalk-repo-sync -c bz1387173
#### Channel label: bz1387173 ####
Repo URL: http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64//
Packages in repo:                25
Packages already synced:          0
Packages to sync:                25
1/25 : rhn-check-2.7.1-1.el7-0.noarch
[...]
25/25 : osa-common-5.11.76-1.el7-0.noarch
Linking packages to channel.
Repo http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64// has comps file comps-spacewalk-client-rhel7.xml.
Repo http://yum.spacewalkproject.org/nightly-client/RHEL/7/x86_64// has 0 errata.
Sync completed.
Total time: 0:00:57


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