comparison sat/memory/params.py @ 3752:5f546dd910e0

core (memory/param): fix unproper use of `Failure`
author Goffi <goffi@goffi.org>
date Fri, 13 May 2022 17:57:24 +0200
parents 358a678e5bdf
children 524856bd7b19
comparison
equal deleted inserted replaced
3751:073f386a191a 3752:5f546dd910e0
184 @param callback: called when the profile actually exists in database and memory 184 @param callback: called when the profile actually exists in database and memory
185 @return: a Deferred instance 185 @return: a Deferred instance
186 """ 186 """
187 if self.storage.hasProfile(profile): 187 if self.storage.hasProfile(profile):
188 log.info(_("The profile name already exists")) 188 log.info(_("The profile name already exists"))
189 return defer.fail(Failure(exceptions.ConflictError)) 189 return defer.fail(exceptions.ConflictError())
190 if not self.host.trigger.point("ProfileCreation", profile): 190 if not self.host.trigger.point("ProfileCreation", profile):
191 return defer.fail(Failure(exceptions.CancelError)) 191 return defer.fail(exceptions.CancelError())
192 return self.storage.createProfile(profile, component or None) 192 return self.storage.createProfile(profile, component or None)
193 193
194 def asyncDeleteProfile(self, profile, force=False): 194 def asyncDeleteProfile(self, profile, force=False):
195 """Delete an existing profile 195 """Delete an existing profile
196 196