core (xmpp): raise InternalError when a new profile Client is created while there is already one in host

This commit is contained in:
Goffi 2020-01-29 11:00:14 +01:00
commit aadf9ed7e4

View file

@ -168,6 +168,9 @@ class SatXMPPEntity(object):
password = yield host.memory.asyncGetParamA(
"Password", "Connection", profile_key=profile
)
if profile in host.profiles:
raise exceptions.InternalError(
f"There is already a profile of name {profile} in host")
entity = host.profiles[profile] = cls(
host, profile, jid.JID(host.memory.getParamA("JabberID", "Connection",
profile_key=profile)), password,