Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    sy 0.3

    Download button

    No screenshots available
    Downloads: 237  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Paul Diaconescu | More programs
    BSD License / FREE
    June 17th, 2011, 10:40 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    sy description

    Simple tools for system administration tasks

    sy is a Python library is a set of easy to use modules to help with automation of system administration tasks. To use the library import the version you want as sy in your script:

    # Import the library
    import sy1 as sy

    # Replace lines in '/etc/hosts' that match nis.*
    sy.path.replace_lines('/etc/hosts', 'nis.*', '10.2.3.1 ldap')
    1

    # Fetch information about the interface hme0
    hme0 = sy.net.intf.get('hme0')

    # Get the IP of hme0
    hme0.ipaddress
    '192.168.2.2'

    # Check if hme0 is up
    hme0.is_up
    True

    # Find files named '*.pl' but time out after 10 seconds
    out, err = sy.cmd.do('find /mnt -name {}', '*.pl', timeout=10)

    # Setup a rotating log file that wont fill the disk
    sy.log.to_file('/var/tmp/app.log')

    # Check if port 22 is answering on bart
    if not sy.net.ip.port_is_open('bart', 22):
     sy.log.warning('Ssh is down on bart')


    Changes in the sy1 library is guaranteed to not break your code. When incompatible changes are introduced new version will be installed as sy2, sy3 and so on.

    The library is heavily inspired by Werkzeug which is a great WSGI utility collection.

    Developing

    The repository path for sy is located at http://github.com/pauldiacon/sy.git. Clone with git by typing:

     git clone http://github.com/pauldiacon/sy.git

    The requirements for developing are listed in dev-reqs.pip that can be install with pip with:

     pip install -r dev-reqs.pip

    The library currently targets python 2.4.4 - 2.6.

    Testing

    To run the test suite use nose:

     nosetests -a '!host' tests

    The !host parameter tells the suite to not run tests that change the hosts configuration (like reconfiguring network interfaces).

    There currently isn't any automated way to run the testsuite on virtual machines. This feature is greatly needed to be able to test all parts of the library and to test it on different versions and operating systems.

    Documentation

    The documentation is built with sphinx and is locate under the docs folder.


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    system administration | administration tools | Python library | administration | tools | Python

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM