summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2013-08-27 11:05:00 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2013-08-28 12:02:30 -0300
commit956330af5a67922e7710e7c4817de8fc15fab5ac (patch)
treea14e583d6f65926ba396674b9dde582690906f88
parent8cce83844448a83ab03cb8a3a04320547e024d06 (diff)
Remove key for a provider with no enabled services
-rw-r--r--src/leap/bitmask/config/leapsettings.py8
1 files 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):
"""