Nir Soffer has posted comments on this change.

Change subject: vdsm-tool: changing root checking in configurator.
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.ovirt.org/#/c/31293/2/lib/vdsm/tool/configurator.py
File lib/vdsm/tool/configurator.py:

Line 678:     def wrapper(*args, **kwargs):
Line 679:         if os.getuid() != 0:
Line 680:             raise NotRootError()
Line 681:         func(*args, **kwargs)
Line 682:     return wrapper
> you have same function in testValidation.py called ValidateRunningAsRoot. I
I think a decorator as Mooli propose is the right way to handle this, and it 
can be a generic utility replacing all others places that check for root.

The decorator can be placed on the module verbs or on specific configurator 
methods, this is very flexible.

Adding this as a method the the base class is the wrong thing to do, as 
testValidation case prove - we need this in lot of places, this is  not a 
method of the the module configurator.
Line 683: 
Line 684: 
Line 685: @expose("configure")
Line 686: @requiresRoot


-- 
To view, visit http://gerrit.ovirt.org/31293
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I52967e30f677e4537b83c2db442963e3eadecb55
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Dima Kuznetsov <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: mooli tayer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to