py3 (4) - update playbook.py to py3 compatibility

This commit is contained in:
Steve Noyes 2015-11-09 13:36:17 -05:00
parent 9bfeb311c3
commit 891e3a1365
1 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,7 @@ import traceback
from kollacli.ansible.inventory import Inventory
from kollacli.exceptions import CommandError
from kollacli.utils import get_admin_user
from kollacli.utils import get_ansible_command
from kollacli.utils import get_kolla_etc
from kollacli.utils import run_cmd
@ -49,9 +50,10 @@ class AnsiblePlaybook(object):
if self.verbose_level > 1:
flag = '-vvv'
ansible_cmd = get_ansible_command(playbook=True)
admin_user = get_admin_user()
command_string = ('/usr/bin/sudo -u %s ansible-playbook %s'
% (admin_user, flag))
command_string = ('/usr/bin/sudo -u %s %s %s'
% (admin_user, ansible_cmd, flag))
inventory = Inventory.load()
inventory_filter = {}
if self.hosts: