show_changed to show data - way too many calls to keyreturn :)
This commit is contained in:
parent
f6e3a85a0a
commit
cfaddae895
2 changed files with 8 additions and 4 deletions
|
@ -17,7 +17,7 @@ def main():
|
||||||
print >> sys.stderr, "No dict found"
|
print >> sys.stderr, "No dict found"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if name in obj:
|
if name in obj:
|
||||||
print '%s: %s' % (name, obj.get(name, None))
|
print '%s:%s' % (name,obj.get(name, None))
|
||||||
else:
|
else:
|
||||||
print >> sys.stderr, "No key %s found" % name
|
print >> sys.stderr, "No key %s found" % name
|
||||||
ret = 1
|
ret = 1
|
||||||
|
|
|
@ -22,21 +22,25 @@ do
|
||||||
dir=`dirname $logpath`
|
dir=`dirname $logpath`
|
||||||
runtime=`basename $dir`
|
runtime=`basename $dir`
|
||||||
echo -n "$runtime - $hostname "
|
echo -n "$runtime - $hostname "
|
||||||
echo $line | cut -d: -f2-| cut -f3-4
|
pre=`echo $line | cut -d: -f2-| cut -f3-4`
|
||||||
json=`echo $line | cut -d: -f2- |cut -f5-`
|
json=`echo $line | cut -d: -f2- |cut -f5-`
|
||||||
echo $json| python -m json.tool 2>/dev/null >&2
|
echo $json| python -m json.tool 2>/dev/null >&2
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
echo "Error parsing json"
|
echo "Error parsing json"
|
||||||
else
|
else
|
||||||
if [ "$verbose" == 'yes' ]; then
|
if [ "$verbose" == 'yes' ]; then
|
||||||
|
echo $pre
|
||||||
echo $json| python -m json.tool
|
echo $json| python -m json.tool
|
||||||
else
|
else
|
||||||
|
echo -n $pre
|
||||||
for term in task_userid cmd task_args task_module; do
|
for term in task_userid cmd task_args task_module; do
|
||||||
echo $json| /srv/web/infra/ansible/scripts/keyreturn $term 2>/dev/null >&2
|
res=`echo $json| /srv/web/infra/ansible/scripts/keyreturn $term 2>/dev/null`
|
||||||
if [ $? == 0 ]; then
|
if [ $? == 0 ]; then
|
||||||
echo $json| /srv/web/infra/ansible/scripts/keyreturn $term
|
echo -n " $res"
|
||||||
|
#$json| /srv/web/infra/ansible/scripts/keyreturn $term
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
echo ''
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue