Attempt #2 to cause yum to fail on invalid url
This commit is contained in:
parent
3f81c3c416
commit
5671ddcdd3
1 changed files with 5 additions and 1 deletions
|
@ -472,7 +472,11 @@ def install(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos):
|
||||||
|
|
||||||
rc, out, err = module.run_command(cmd)
|
rc, out, err = module.run_command(cmd)
|
||||||
|
|
||||||
if (rc != 0 and 'Nothing to do' in err) or 'Nothing to do' in out:
|
# Fail on invalid urls:
|
||||||
|
if '://' in spec and 'No package %s available.' % spec in out:
|
||||||
|
err = 'Package at %s could not be installed' % spec
|
||||||
|
module.fail_json(changed=False,msg=err,rc=1)
|
||||||
|
elif (rc != 0 and 'Nothing to do' in err) or 'Nothing to do' in out:
|
||||||
# avoid failing in the 'Nothing To Do' case
|
# avoid failing in the 'Nothing To Do' case
|
||||||
# this may happen with an URL spec.
|
# this may happen with an URL spec.
|
||||||
# for an already installed group,
|
# for an already installed group,
|
||||||
|
|
Loading…
Reference in a new issue