From: Zack Cerza Date: Fri, 15 Apr 2016 21:52:18 +0000 (-0600) Subject: ansible.CephLab: touch ~/.vault_pass.txt X-Git-Tag: 1.1.0~626^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F845%2Fhead;p=teuthology.git ansible.CephLab: touch ~/.vault_pass.txt To avoid ansible bailing with an OSError. Normally we don't even need the vault password for cephlab.yml. Signed-off-by: Zack Cerza --- diff --git a/teuthology/task/ansible.py b/teuthology/task/ansible.py index f29068239..b6cb9fbd8 100644 --- a/teuthology/task/ansible.py +++ b/teuthology/task/ansible.py @@ -371,6 +371,15 @@ class CephLab(Ansible): 'ceph-cm-ansible.git') super(CephLab, self).__init__(ctx, config) + def begin(self): + # Emulate 'touch ~/.vault_pass.txt' to avoid ansible failing; + # in almost all cases we don't need the actual vault password + vault_pass_path = os.path.expanduser('~/.vault_pass.txt') + if not os.path.exists(vault_pass_path): + with open(vault_pass_path, 'a'): + pass + super(CephLab, self).begin() + task = Ansible cephlab = CephLab