[Tutor] Development of administration utility

Martin A. Brown martin at linux-ip.net
Thu Aug 21 18:42:33 CEST 2014


Greetings Alessandro,

 : We are currently investigating different languages and technologies to
 : develop an command line administration utility.
 : Python is one of the options we are looking at for the job but currently we
 : have no relevant skill set so I thought I'd post some question to get an idea
 : if using python is something worth pursuing or not.
 : 
 : The utility should have the following characteristics:
 : 
 : 1. support for sub commands and parameters (e.g. svn or git)
 : 2. integration with bash_completion
 : 3. Modular. The idea would be that by installing different  packages
 :    (or RPMs), new sub-commands and parameters will be made available to
 :    the utility. E.g.,
 :     1. "Base" package is installed: subcommand available is "view-config "
 :     2.   "Base" and "database" package are installed, subcommands
 :        available are "view-config" and "backup-db"
 : 4. Support for executing remote commands via ssh

 : I have no doubt that with enough effort, a Python application could be
 : developed to implement the above.
 : However, I'm not too sure if Python is the right tools for the job
 : particularly about point 3:
 : 
 : 1. Is there a built-in discovery mechanism like Java SPI
 :    (http://docs.oracle.com/javase/tutorial/sound/SPI-intro.html)?

I don't know SPI, and this link didn't help me understand quite what 
you meant by discovery.  <opinion>Flexible discovery is very 
difficult.</opinion>

 : 2. Are there any libraries/framework we could build upon or would we    need
 : to start from scratch?

Yes.  In elements 1. and 3. above, it sounds almost like you are 
describing the features of argparse (available for Python 2.x and 
3.x).  See documentation here:

  https://docs.python.org/2/library/argparse.html
  https://docs.python.org/3/library/argparse.html

I think item 2. about bash_completion bit is outside the scope of 
Python, specifically, though, and more of an operating environment 
thing.

 : 3. Should we consider 2.x or 3.x in order to ensure cross system
 :    compatibility (linux, windows)?

Others may chime in on this.  I, personally, will choose what my 
platform chooses (still Python-2.x), so I'm a "behind the adoption 
curve" kind of guy.

You also mentioned, in item 4. above about ssh.  It's hard to have 
completion oriented tools and (reliable) remote execution support 
without a uniformly administered set of systems.  Of course, you can 
call ssh from Python, but in this case, it seems like you'd have a 
simpler system by leaving the ssh out of the mix.  If you want to 
use ssh from Python, there's paramiko.

  https://pypi.python.org/pypi/paramiko/

 : Any feedback on any of the points above would be greatly appreciated.

I don't know if this is the sort of feedback that you were looking 
for, so I'll just stop there.

Good luck,

-Martin


More information about the Tutor mailing list