Resolve traceback on shutdown.

This commit is contained in:
Jonathan Piacenti 2015-02-26 23:23:38 -06:00 committed by Griatch
parent be13998771
commit aac9ba7b8b

View file

@ -231,22 +231,21 @@ class DefaultPlayer(PlayerDB):
# re-cache locks to make sure superuser bypass is updated # re-cache locks to make sure superuser bypass is updated
obj.locks.cache_lock_bypass(obj) obj.locks.cache_lock_bypass(obj)
def unpuppet_object(self, sessid): def unpuppet_object(self, sessid, ignore_empty=False):
""" """
Disengage control over an object Disengage control over an object
Args: Args:
sessid(int): the session id to disengage sessid(int): the session id to disengage
ignore_empty(bool): ignores sessions without puppets
Raises: Raises:
RuntimeError with message about error. RuntimeError with message about error.
""" """
if _MULTISESSION_MODE == 1: if _MULTISESSION_MODE == 1:
sessions = self.get_all_sessions() sessions = self.get_all_sessions()
ignore_empty = True
else: else:
sessions = self.get_session(sessid) sessions = self.get_session(sessid)
ignore_empty = False
if not sessions: if not sessions:
raise RuntimeError("No session was found.") raise RuntimeError("No session was found.")
for session in make_iter(sessions): for session in make_iter(sessions):
@ -270,7 +269,7 @@ class DefaultPlayer(PlayerDB):
before a reset/shutdown. before a reset/shutdown.
""" """
for session in self.get_all_sessions(): for session in self.get_all_sessions():
self.unpuppet_object(session.sessid) self.unpuppet_object(session.sessid, ignore_empty=True)
def get_puppet(self, sessid, return_dbobj=False): def get_puppet(self, sessid, return_dbobj=False):
""" """