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.
This commit is contained in:
Marek Marczykowski 2012-05-31 02:57:28 +02:00
parent c81cc32da2
commit d89733b517
2 changed files with 8 additions and 0 deletions

View File

@ -1211,6 +1211,13 @@ class QubesVm(object):
os.path.basename(sys.argv[0]), err) os.path.basename(sys.argv[0]), err)
return False 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 return True
def has_firewall(self): def has_firewall(self):

View File

@ -314,6 +314,7 @@ def main():
if vm.is_running(): if vm.is_running():
if vm.netvm is not None and vm.netvm.is_proxyvm(): if vm.netvm is not None and vm.netvm.is_proxyvm():
vm.netvm.write_iptables_xenstore_entry() vm.netvm.write_iptables_xenstore_entry()
qvm_collection.save()
if not options.do_list: if not options.do_list:
qvm_collection.unlock_db() qvm_collection.unlock_db()