1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

composer: Fix changed status that always returns False

re.match in has_changed function never worked properly, because match
requires searched sequence to be present exactly at a start of processed
string, which is not the case here.
This commit is contained in:
anatoly techtonik 2014-10-09 18:58:03 +03:00 committed by Matt Clay
parent 5e9f16b206
commit cb70fbc9d1

View file

@ -101,7 +101,10 @@ def parse_out(string):
return re.sub("\s+", " ", string).strip() return re.sub("\s+", " ", string).strip()
def has_changed(string): def has_changed(string):
return (re.match("Nothing to install or update", string) != None) if "Nothing to install or update" in string:
return False
else:
return True
def composer_install(module, command, options): def composer_install(module, command, options):
php_path = module.get_bin_path("php", True, ["/usr/local/bin"]) php_path = module.get_bin_path("php", True, ["/usr/local/bin"])