session = kwargs.get('session')
# No session specified as last argument or in kwargs, create one.
- if session is None and len(args) == len(getargspec(fn)[0]) - 1:
+ if session is None and len(args) <= len(getargspec(fn)[0]) - 1:
private_transaction = True
kwargs['session'] = DBConn().session()
# We created a session; close it.
kwargs['session'].close()
+ wrapped.__doc__ = fn.__doc__
+ wrapped.func_name = fn.func_name
+
return wrapped
################################################################################
@session_wrapper
def get_archive(archive, session=None):
"""
- returns database id for given c{archive}.
+ returns database id for given C{archive}.
@type archive: string
@param archive: the name of the arhive
# TODO: Move into database as above
if conf.FindB("Dinstall::SecurityQueueBuild"):
# Copy it since the original won't be readable by www-data
+ import utils
utils.copy(src, dest)
else:
# Create a symlink to it
generated if not supplied)
@rtype: Suite
- @return: Suite object for the requested suite name (None if not presenT)
+ @return: Suite object for the requested suite name (None if not present)
"""
q = session.query(Suite).filter_by(suite_name=suite)