[PATCH blivet/master 1/3] devicelibs.lvm: refactor _getConfigArgs()/lvm()

Will Woods wwoods at redhat.com
Tue Sep 23 16:25:38 UTC 2014


On Mon, 2014-09-22 at 08:14 -0400, Anne Mulhern wrote:
> Moving _getConfigArgs() into lvm seems fine with me.
> 
> But, better to extend lvm() in a principled manner than to invent new method lvm_output.
> Seems more consistent w/ idea of moving _getConfigArgs() call into lvm(), anyway.
> See example in mdraid.py.

I'd been thinking of them as analogues to subprocess.{call,check_output}
but yeah, the mdraid() approach makes sense.

> Fine w/ READONLY_COMMANDS change, generally, but think variable
> READONLY_COMMANDS should be local to _getConfigArgs(),
> not file global.

I... generally define those outside the scope of the function as a
(possibly trivial) optimization, i.e. initialize the list once rather
than on every function call? I wonder if the python interpreter
optimizes that out?

> Please make sure to verify relevant tests succeed, you need to be root to run the majority.

Yup - I mentioned that in the initial email:
> 'make test' shows no new failures after adding this code.

-w




More information about the anaconda-patches mailing list