comparison sat/core/xmpp.py @ 3138:d8a89a77d765

core (xmpp): raise InternalError when a new profile Client is created while there is already one in host
author Goffi <goffi@goffi.org>
date Wed, 29 Jan 2020 11:00:14 +0100
parents 559a625a236b
children f3700175c6a3
comparison
equal deleted inserted replaced
3137:559a625a236b 3138:d8a89a77d765
166 ) # will use default value 5222 or be retrieved from a DNS SRV record 166 ) # will use default value 5222 or be retrieved from a DNS SRV record
167 167
168 password = yield host.memory.asyncGetParamA( 168 password = yield host.memory.asyncGetParamA(
169 "Password", "Connection", profile_key=profile 169 "Password", "Connection", profile_key=profile
170 ) 170 )
171 if profile in host.profiles:
172 raise exceptions.InternalError(
173 f"There is already a profile of name {profile} in host")
171 entity = host.profiles[profile] = cls( 174 entity = host.profiles[profile] = cls(
172 host, profile, jid.JID(host.memory.getParamA("JabberID", "Connection", 175 host, profile, jid.JID(host.memory.getParamA("JabberID", "Connection",
173 profile_key=profile)), password, 176 profile_key=profile)), password,
174 host.memory.getParamA(C.FORCE_SERVER_PARAM, "Connection", 177 host.memory.getParamA(C.FORCE_SERVER_PARAM, "Connection",
175 profile_key=profile) or None, 178 profile_key=profile) or None,