rconradharris/nova — comment on commit bb9630d5455a53817967c9e470975d7a1073e277
File: nova/db/sqlalchemy/api.py line 153
By comstud:

I think you want: kwargs.get('session') or get_session(). There's a number of cases where 'session' will exist in kwargs, though it will be None.