How to handle calling functions from cli

2012-02-24 Thread Rodrick Brown
I have a bunch of sub routines that run independently to perform various system checks on my servers. I wanted to get an opinion on the following code I have about 25 independent checks and I'm adding the ability to disable certain checks that don't apply to certain hosts. m = { 'a':

Re: How to handle calling functions from cli

2012-02-24 Thread Chris Rebert
On Fri, Feb 24, 2012 at 2:16 PM, Rodrick Brown rodrick.br...@gmail.com wrote: I have a bunch of sub routines that run independently to perform various system checks on my servers. I wanted to get an opinion on the following code I have about 25 independent checks and I'm adding the ability to

Re: How to handle calling functions from cli

2012-02-24 Thread Chris Angelico
On Sat, Feb 25, 2012 at 9:16 AM, Rodrick Brown rodrick.br...@gmail.com wrote: m = { 'a': 'checkDisks()',          'b': 'checkMemSize()',          'c': 'checkBondInterfaces()'    }    runlist = [ c for c in m.keys() if c not in r.d ]    for runable in runlist:        eval(m[runable]) It's