Bug 950407

Summary: 'fetchmirrors' feature prevents unified handling of local and remote handles
Product: [Fedora] Fedora Reporter: Ales Kozumplik <akozumpl>
Component: librepoAssignee: Tomas Mlcoch <tmlcoch>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: jzeleny, tmlcoch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-17 11:48:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ales Kozumplik 2013-04-10 08:24:39 UTC
'fetchmirrors' allows downloading only the mirrorlists via peform() as was requested, but unfortunately its behavior intorduces new issues:

a) for remote repo, doing handle.perform() always fills in handle.mirrors
b) for local repo, doing handle.perform() doesn't fill in handle.mirrors

that means to obtain the mirrors list one has to treat the local and the remote handle in a different manner and add extra call to:

  handle.fetchmirrors = True
  handle.perform()

to the local handle. This is not what the feature was meant for, there is no reason not to fill in the mirror list when we are contacting the provider anyway, especially for a local handle. I suggest changing the semantics to:

- handle.mirrors is guaranteed to be non-None after any perform()
- if fetchmirrors is True ignore LRO_YUMDLIST and only download the mirrorlist.

There are no serious reasons not to always fill in handle.mirrors, especially for a local repo.

Comment 1 Tomas Mlcoch 2013-04-18 12:21:41 UTC
Hi, behavior changed:
https://github.com/Tojaj/librepo/commit/88c90e3935cd85a17b46bd414e588a62f8b9fceb

Few notes:
- handle.mirrors will be filled with content of mirrorlist specified by LRO_MIRRORLIST.
- in case of local repository which contains a mirrorlist file, handle.mirrors will be filled with content of the file.
- in case of local repository with mirrorlist file and LRO_MIRRORLIST option specified then handle.mirrors will contain mirrors from LRO_MIRRORLIST
- in other cases like: 
  - only LRO_URL for a remote repo is used
  - only LRO_URL for a local repo that doesn't have a mirrorlist stored
  handle.mirrors will be empty.