# HG changeset patch # User Goffi # Date 1495389582 -7200 # Node ID 83bcd9ec47825830002dc79d5ca77a4b293bd948 # Parent 6c1070ae1b7d9c0454a3debefd0610c7c7872c92 core: fixed profile key detection in getClients + raise DataError on empty profile diff -r 6c1070ae1b7d -r 83bcd9ec4782 src/core/sat_main.py --- a/src/core/sat_main.py Sun May 21 19:57:46 2017 +0200 +++ b/src/core/sat_main.py Sun May 21 19:59:42 2017 +0200 @@ -455,13 +455,15 @@ @param profile_key: %(doc_profile_key)s @return: list of clients """ + if not profile_key: + raise exceptions.DataError(_(u'profile_key must not be empty')) try: profile = self.memory.getProfileName(profile_key, True) except exceptions.ProfileUnknownError: return [] if profile == C.PROF_KEY_ALL: return self.profiles.values() - elif profile.count('@') > 1: + elif profile[0] == '@': # only profile keys can start with "@" raise exceptions.ProfileKeyUnknown return [self.profiles[profile]]