]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
ansible.CephLab: touch ~/.vault_pass.txt 845/head
authorZack Cerza <zack@redhat.com>
Fri, 15 Apr 2016 21:52:18 +0000 (15:52 -0600)
committerZack Cerza <zack@redhat.com>
Fri, 15 Apr 2016 21:52:18 +0000 (15:52 -0600)
To avoid ansible bailing with an OSError. Normally we don't even need
the vault password for cephlab.yml.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/task/ansible.py

index f290682399d81b1913ae2754ad34cdee1527f3df..b6cb9fbd841a82292cf45f69d6173735bb64ea00 100644 (file)
@@ -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