Removed "" and changed the call to check_call to make it race the appropriate error

This commit is contained in:
Stefan Jonasson 2016-02-12 19:31:28 +01:00
parent 10a20f802b
commit 5a03ddd7e0

View File

@ -39,8 +39,9 @@ class CommandLineNotificationService(BaseNotificationService):
def send_message(self, message="", **kwargs):
""" Send a message to a command_line. """
try:
subprocess.call("{} \"{}\"".format(self.command,
shlex.quote(message)),
shell=True)
subprocess.check_call(
"{} {}".format(self.command,
shlex.quote(message)),
shell=True)
except subprocess.CalledProcessError:
_LOGGER.error('Command failed: %s', self.command)