GithubHelp home page GithubHelp logo

dandb / salt-nanny Goto Github PK

View Code? Open in Web Editor NEW
5.0 11.0 8.0 61 KB

Python Module that parses salt returns stored in redis and logs output

License: GNU General Public License v3.0

Python 100.00%

salt-nanny's Introduction

salt-nanny Build Status Coverage Status

Python Module that parses salt returns stored in redis and logs output

Example Usage:

Command Line Usage:

salt-nanny localhost minion1 minion2

Look for salt returns in localhost for minions - minion1 & minion2

salt-nanny localhost minion1 minion2 -p 6380 -x 20 -I 5 60 2

This command tells salt-nanny to wait 5, 10, 20, 40 and 60 seconds between each retry initially and then 60s for subsequent retries. Attempt 20 times and then give up. Use port 6380 for redis.

salt-nanny localhost minion1 -r -j 20170905144844350779

This command tells salt-nanny to return results from minion minion1 that have higher JID than 20170905144844350779

Example Python code:

#!/usr/bin/env python
import salt.client
from saltnanny import SaltNanny

# Initialize SaltNanny with the cache & salt function
config = {'type': 'redis', 'host':'localhost', 'port':6379, 'db':'0'}
nanny = SaltNanny(config, 'test', 'state.highstate')

# Use SaltNanny to track returns to the external job cache
salt_nanny.initialize(['minion1', 'minion2'])
salt_nanny.track_returns()
return_code = salt_nanny.process_returns()
  • For the example above, the log file in logs/test-state.highstate.log will contain results of the salt highstate
  • The return code is 0 if all the salt functions for all minions succeded with a return dict containing retcode:0.
  • SaltNanny also checks state results in case of a highstate. If any one state fails, the retcode is non zero.

salt-nanny's People

Contributors

ishwinder-singh avatar mprince avatar nz285 avatar saundersg-dnb avatar taoistmath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.