mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-30 08:50:55 +08:00
Various tweaks to the needs-updates script
This commit is contained in:
@@ -27,7 +27,6 @@ def main(args):
|
||||
help="list the updates needed", default=False)
|
||||
options, args = parser.parse_args(args)
|
||||
list_updates=options.listupdates
|
||||
del options.listupdates
|
||||
options.module_name = 'yum'
|
||||
options.module_args = 'list=updates'
|
||||
|
||||
@@ -48,12 +47,13 @@ def main(args):
|
||||
module_name=options.module_name, module_path=options.module_path,
|
||||
module_args=options.module_args,
|
||||
remote_user=options.remote_user,
|
||||
host_list=options.inventory, timeout=options.timeout,
|
||||
forks=options.forks,
|
||||
host_list=options.inventory,
|
||||
timeout=300,
|
||||
forks=10,
|
||||
pattern=options.pattern,
|
||||
callbacks=mycallback,
|
||||
transport=options.connection
|
||||
callbacks=mycallback
|
||||
)
|
||||
print "Checking for updates on %s" % (options.pattern)
|
||||
|
||||
updates = ""
|
||||
needsupdate = []
|
||||
@@ -75,8 +75,8 @@ def main(args):
|
||||
if msg:
|
||||
print >> sys.stderr, 'Error: %s said %s' % (host, msg)
|
||||
|
||||
for host in results['dark']:
|
||||
print >> sys.stderr, 'Error: Could not reach: %s' % host
|
||||
for (host,d) in results['dark'].items():
|
||||
print "%s failed because (%s)" % (host,d)
|
||||
|
||||
for host in sorted(needsupdate):
|
||||
print host
|
||||
|
||||
Reference in New Issue
Block a user