Skip to content
Snippets Groups Projects
Commit f94adfe0 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Add kwargs parameter to sysprep decorator

This can be used to add arbitrary attributes to the function it
decorates
parent 811b7149
No related branches found
No related tags found
No related merge requests found
......@@ -68,13 +68,16 @@ def add_prefix(target):
return wrapper
def sysprep(message, enabled=True):
def sysprep(message, enabled=True, **kwargs):
"""Decorator for system preparation tasks"""
def wrapper1(func):
func.sysprep = True
func.enabled = enabled
func.executed = False
for key, val in kwargs.items():
setattr(func, key, val)
@wraps(func)
def wrapper2(self, print_message=True):
if print_message:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment