Commit b4605d83 authored by Marco Mariani's avatar Marco Mariani

fixed decorator, was a no-op :-/

parent 6a34a511
...@@ -22,8 +22,9 @@ class Command(cliff.command.Command): ...@@ -22,8 +22,9 @@ class Command(cliff.command.Command):
def must_be_root(func): def must_be_root(func):
@functools.wraps(func) @functools.wraps(func)
def func(self, *args, **kw): def inner(self, *args, **kw):
if os.getuid() != 0: if os.getuid() != 0:
self.app.log.error('This slapos command must be run as root.') self.app.log.error('This slapos command must be run as root.')
sys.exit(5) sys.exit(5)
return func return func(self, *args, **kw)
return inner
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment