qubes-core-admin-linux/qubes-rpc/qubes.repos.Disable

25 lines
469 B
Plaintext
Raw Normal View History

#!/usr/bin/python3
# `ok` on stdout indicates success; any stderr output indicates an error
# (probably an exception)
import dnf
2018-12-09 06:46:38 +00:00
import os
import sys
2018-12-09 07:03:17 +00:00
os.umask(0o022)
base = dnf.Base()
base.read_all_repos()
2018-12-09 07:09:46 +00:00
reponame = sys.argv[1]
repo = base.repos[reponame]
base.conf.write_raw_configfile(repo.repofile,
repo.id,
base.conf.substitutions,
{'enabled': '0'})
print('ok')