cherry-pick commit e56c001 for Session() instead of EmuSession() class

This commit is contained in:
Jeff Ahrenholz 2019-10-02 07:55:51 -07:00
parent 22341a748c
commit 6c3066e752

View file

@ -85,12 +85,13 @@ class CoreEmu(object):
session = sessions[_id] session = sessions[_id]
session.shutdown() session.shutdown()
def create_session(self, _id=None, master=True): def create_session(self, _id=None, master=True, _cls=Session):
""" """
Create a new CORE session, set to master if running standalone. Create a new CORE session, set to master if running standalone.
:param int _id: session id for new session :param int _id: session id for new session
:param bool master: sets session to master :param bool master: sets session to master
:param class _cls: Session class to use
:return: created session :return: created session
:rtype: EmuSession :rtype: EmuSession
""" """
@ -100,7 +101,7 @@ class CoreEmu(object):
if _id not in self.sessions: if _id not in self.sessions:
break break
session = Session(_id, config=self.config) session = _cls(_id, config=self.config)
logging.info("created session: %s", _id) logging.info("created session: %s", _id)
if master: if master:
session.master = True session.master = True