pyinfra-dev / pyinfra

pyinfra turns Python code into shell commands and runs them on your servers. Execute ad-hoc commands and write declarative operations. Target SSH servers, local machine and Docker containers. Fast and scales from one server to thousands.
https://pyinfra.com
MIT License
3.93k stars 383 forks source link

AptSources uses set for components #1198

Closed rsfzi closed 2 months ago

rsfzi commented 2 months ago

Describe the bug

AptSources uses a set for the list of components. This makes removals of existing entries with at.repo() nearly impossible.

To Reproduce

sources.list: deb [arch=amd64] https://deb.debian.org/debian/ bullseye main contrib non-free

code: sources = host.get_fact(AptSources) components returned in this order: contrib non-free main

Expected behavior

The components should be a list in this order: main contrib non-free

I'm currently working on a patch and will add an pull request.