runner buglet and yum module

runner: fix buglet causing logger output to include a u for the command
yum: add yum module:
   ensure=installed pkg=name/name.arch/name-ver-rel.arch
   ensure=removed pkg=name/name.arch/name-ver-rel.arch
   list=installed
   list=updates
   list=available
   list=pkgspec
   list=repos
This commit is contained in:
Seth Vidal 2012-03-09 18:33:58 -05:00
commit b576e389b1
2 changed files with 236 additions and 1 deletions

View file

@ -374,12 +374,13 @@ class Runner(object):
def remote_log(self, conn, msg):
''' this is the function we use to log things '''
stdin, stdout, stderr = conn.exec_command('/usr/bin/logger -t ansible -p auth.info %r' % msg)
stdin, stdout, stderr = conn.exec_command('/usr/bin/logger -t ansible -p auth.info "%s"' % msg)
# TODO: maybe make that optional
def _exec_command(self, conn, cmd):
''' execute a command string over SSH, return the output '''
msg = '%s: %s' % (self.module_name, cmd)
self.remote_log(conn, msg)
stdin, stdout, stderr = conn.exec_command(cmd)
results = "\n".join(stdout.readlines())