diff options
| author | Seth Vidal <skvidal@fedoraproject.org> | 2013-07-03 22:46:34 +0000 |
|---|---|---|
| committer | Seth Vidal <skvidal@fedoraproject.org> | 2013-07-03 22:46:34 +0000 |
| commit | 1efa8496d57beeac1b13ace2b991b9aaad2cc665 (patch) | |
| tree | 1235e074fc2f98e3467252fe4f90e6565a132cba /scripts | |
| parent | fbedc5fb6063280c78e62df45169d19f69061159 (diff) | |
simple json key returner for what we dump
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/keyreturn | 25 | ||||
| -rwxr-xr-x | scripts/show-changed | 6 |
2 files changed, 30 insertions, 1 deletions
diff --git a/scripts/keyreturn b/scripts/keyreturn new file mode 100755 index 000000000..d711ad3a4 --- /dev/null +++ b/scripts/keyreturn @@ -0,0 +1,25 @@ +#!/usr/bin/python -tt + +import json +import sys + +# take json in +# return keys from data if they exist + + + +def main(): + infile = sys.stdin + obj = json.load(infile) + for name in sys.argv[1:]: + if type(obj) != dict: + print >> sys.stderr, "No dict found" + sys.exit(1) + if name in obj: + print '%s: %s' % (name, obj.get(name, None)) + else: + print >> sys.stderr, "No key %s found" % name + +if __name__ == '__main__': + main() +
\ No newline at end of file diff --git a/scripts/show-changed b/scripts/show-changed index d62d70f5b..cddc5616a 100755 --- a/scripts/show-changed +++ b/scripts/show-changed @@ -30,7 +30,10 @@ do else if [ "$verbose" == 'yes' ]; then echo $json| python -m json.tool - fi + else + echo $json| /srv/web/infra/ansible/scripts/keyreturn task_userid + echo $json| /srv/web/infra/ansible/scripts/keyreturn cmd + fi fi done @@ -64,6 +67,7 @@ fi for pb in $logpath/$where/; do if [ -d $pb/$ts ]; then + echo `basename $pb` search_logs $pb/$ts/*/*.log fi done |
