Code review comment for lp:~ed-leafe/nova/powerstate

Revision history for this message
Trey Morris (tr3buchet) wrote :

 > Probably not, but that's a good thing - we shouldn't be mixing admin-only stuff with general user
 > functionality - too much of a chance for someone down the line to confuse which is which. The idea
 > is that if this is not running in an admin situation, the module will not get loaded at all.

we're saying the same thing here. Would be nice if we could decorate the functions as @admin_api so that right there with the function definition you specify it's going to be a part of the admin api. Then get_resources() could always return all of the functions, excepting those with @admin_only decorators when the admin api isn't specified, which in this case would turn out to be [].

 > Good catch - done.

why not make the non-xen hypervisors raise NotImplemented instead of passing in virt/hypervisor/connection.py? This way it will be logged when you try to perform action that isn't underneath the hood, otherwise how would you know?

« Back to merge proposal