Various tweaks to the needs-updates script
This commit is contained in:
parent
2fc9e30bea
commit
97246173c2
1 changed files with 7 additions and 7 deletions
|
@ -27,7 +27,6 @@ def main(args):
|
||||||
help="list the updates needed", default=False)
|
help="list the updates needed", default=False)
|
||||||
options, args = parser.parse_args(args)
|
options, args = parser.parse_args(args)
|
||||||
list_updates=options.listupdates
|
list_updates=options.listupdates
|
||||||
del options.listupdates
|
|
||||||
options.module_name = 'yum'
|
options.module_name = 'yum'
|
||||||
options.module_args = 'list=updates'
|
options.module_args = 'list=updates'
|
||||||
|
|
||||||
|
@ -48,12 +47,13 @@ def main(args):
|
||||||
module_name=options.module_name, module_path=options.module_path,
|
module_name=options.module_name, module_path=options.module_path,
|
||||||
module_args=options.module_args,
|
module_args=options.module_args,
|
||||||
remote_user=options.remote_user,
|
remote_user=options.remote_user,
|
||||||
host_list=options.inventory, timeout=options.timeout,
|
host_list=options.inventory,
|
||||||
forks=options.forks,
|
timeout=300,
|
||||||
|
forks=10,
|
||||||
pattern=options.pattern,
|
pattern=options.pattern,
|
||||||
callbacks=mycallback,
|
callbacks=mycallback
|
||||||
transport=options.connection
|
|
||||||
)
|
)
|
||||||
|
print "Checking for updates on %s" % (options.pattern)
|
||||||
|
|
||||||
updates = ""
|
updates = ""
|
||||||
needsupdate = []
|
needsupdate = []
|
||||||
|
@ -75,8 +75,8 @@ def main(args):
|
||||||
if msg:
|
if msg:
|
||||||
print >> sys.stderr, 'Error: %s said %s' % (host, msg)
|
print >> sys.stderr, 'Error: %s said %s' % (host, msg)
|
||||||
|
|
||||||
for host in results['dark']:
|
for (host,d) in results['dark'].items():
|
||||||
print >> sys.stderr, 'Error: Could not reach: %s' % host
|
print "%s failed because (%s)" % (host,d)
|
||||||
|
|
||||||
for host in sorted(needsupdate):
|
for host in sorted(needsupdate):
|
||||||
print host
|
print host
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue