From 65fc62a989ab7528c93d36694892fa16ea2503e3 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 31 May 2012 02:57:28 +0200 Subject: [PATCH] dom0/core: setup yum to use proxy when it have access to it (#568) To simplify configuration, automatically enable 'yum-proxy-setup' pseudo-service when allowing access to the proxy. Also disable this service, when access is revoked. Thanks to this the user can enable this feature by one click in firewall settings. --- dom0/qvm-core/qubes.py | 7 +++++++ dom0/qvm-tools/qvm-firewall | 1 + 2 files changed, 8 insertions(+) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 3b16486c..a6550996 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -1203,6 +1203,13 @@ class QubesVm(object): os.path.basename(sys.argv[0]), err) return False + # Automatically enable/disable 'yum-proxy-setup' service based on allowYumProxy + if conf['allowYumProxy']: + self.services['yum-proxy-setup'] = True + else: + if self.services.has_key('yum-proxy-setup'): + self.services.pop('yum-proxy-setup') + return True def has_firewall(self): diff --git a/dom0/qvm-tools/qvm-firewall b/dom0/qvm-tools/qvm-firewall index b5af141e..581fd3ca 100755 --- a/dom0/qvm-tools/qvm-firewall +++ b/dom0/qvm-tools/qvm-firewall @@ -314,6 +314,7 @@ def main(): if vm.is_running(): if vm.netvm is not None and vm.netvm.is_proxyvm(): vm.netvm.write_iptables_xenstore_entry() + qvm_collection.save() if not options.do_list: qvm_collection.unlock_db()