Add DB refresh/expire on specific parameters
Previously we could only refresh or expire the entire object. Change-Id: I2207349d6ffff435538a577943316cd13e7f1355 Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
parent
84841e53fd
commit
3100a898b5
|
@ -61,21 +61,21 @@ class HeatBase(object):
|
|||
else:
|
||||
raise
|
||||
|
||||
def expire(self, session=None):
|
||||
def expire(self, session=None, attrs=None):
|
||||
"""Expire this object ()."""
|
||||
if not session:
|
||||
session = Session.object_session(self)
|
||||
if not session:
|
||||
session = get_session()
|
||||
session.expire(self)
|
||||
session.expire(self, attrs)
|
||||
|
||||
def refresh(self, session=None):
|
||||
def refresh(self, session=None, attrs=None):
|
||||
"""Refresh this object."""
|
||||
if not session:
|
||||
session = Session.object_session(self)
|
||||
if not session:
|
||||
session = get_session()
|
||||
session.refresh(self)
|
||||
session.refresh(self, attrs)
|
||||
|
||||
def delete(self, session=None):
|
||||
"""Delete this object."""
|
||||
|
|
Loading…
Reference in New Issue