fedora-infra / mirrormanager2

Rewrite of the MirrorManager application in Flask and SQLAlchemy
https://mirrormanager.fedoraproject.org
GNU General Public License v2.0
63 stars 46 forks source link

location.hosts does not exist #296

Open awsome0305 opened 2 years ago

awsome0305 commented 2 years ago

When I use command "mm2_refresh_mirrorlist_cache",there is an ERROR about "AttributeError: 'Location' object has no attribute 'hosts'"

I found that command use "lib/mirrorlist.py".In the fun "location_cache",the code is like following def location_cache(session): cache = {} for location in mirrormanager2.lib.get_locations(session):

This does not work - location.hosts does not exist

    cache[location.name] = [host.id for host in list(location.hosts)]
return cache

I found there is no "hosts" in the table "location"

Is this a bug?Or some mistake for me?

adrianreber commented 2 years ago

You are right. Location is from the original mirrormanager implementation and never brought to mirrormanager 2.

Additionally this code isn't used in Fedora anymore at all as we are using the Rust based implementation.