From 1ad3ef4fdacd02d0022f5039ee67e5bf4f578a82 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Tue, 27 Aug 2013 11:05:00 -0300 Subject: Remove key for a provider with no enabled services --- src/leap/bitmask/config/leapsettings.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/leap/bitmask/config/leapsettings.py b/src/leap/bitmask/config/leapsettings.py index 6aab84e4..c1fabd9c 100644 --- a/src/leap/bitmask/config/leapsettings.py +++ b/src/leap/bitmask/config/leapsettings.py @@ -170,8 +170,12 @@ class LeapSettings(object): leap_assert(len(provider) > 0, "We need a nonempty provider") leap_assert_type(services, list) - self._settings.setValue("%s/Services" % (provider,), - services) + key = "{0}/Services".format(provider) + if not services: + # if there are no enabled services we don't need that key + self._settings.remove(key) + else: + self._settings.setValue(key, services) def get_user(self): """ -- cgit v1.2.3