phgrau/ansible-stuff — pull request #3 by dreamnid (2014-03-20 07:03:54+00:00)
Title: Fix not being able to parse output

It looks like there is additional output since this code was originally written when running the "update_alternatives --query" command.

I had to switch from re.match to re.search as the first output is "Name" and not "Status". Even though you have the MULTILINE flag enabled, re.match will ignore it.

Another issue is that the Slaves (which is multiline) will be printed in between Link and Status. I simple do a non-greedy match for anything that appears between Link and Status. I'm hoping the way I did won't break existing code.

Tested against Ubuntu 13.10 and Python 2.7.5+