saltstack/salt — pull request #452 by jcollie (2012-01-06 22:15:33+00:00)
Title: Fix a couple of problems with systemd service status command

The status command for systemd services had a couple of problems:

1) The awk script used braces which needed to be escaped when using .format
2) It was using the 'systemctl restart' subcommand instead of status.

Also, using awk to parse the output of systemctl doesn't seem very
efficient, especially when we have a perfectly good Python interpreter
at hand.

This fixes the above problems by using Python code to look for the
main pid from the 'systemctl show' command output. 'systemctl show'
has the same information as 'systemctl status' except in a more
machine-readable format.