(devstack_node, ceph_node)
| 137 | |
| 138 | |
| 139 | def distribute_ceph_keys(devstack_node, ceph_node): |
| 140 | log.info("Copying Ceph keys to DevStack node...") |
| 141 | |
| 142 | def copy_key(from_remote, key_name, to_remote, dest_path, owner): |
| 143 | key_stringio = BytesIO() |
| 144 | from_remote.run( |
| 145 | args=['sudo', 'ceph', 'auth', 'get-or-create', key_name], |
| 146 | stdout=key_stringio) |
| 147 | key_stringio.seek(0) |
| 148 | to_remote.write_file(dest_path, key_stringio, owner=owner, sudo=True) |
| 149 | keys = [ |
| 150 | dict(name='client.glance', |
| 151 | path='/etc/ceph/ceph.client.glance.keyring', |
| 152 | # devstack appears to just want root:root |
| 153 | #owner='glance:glance', |
| 154 | ), |
| 155 | dict(name='client.cinder', |
| 156 | path='/etc/ceph/ceph.client.cinder.keyring', |
| 157 | # devstack appears to just want root:root |
| 158 | #owner='cinder:cinder', |
| 159 | ), |
| 160 | dict(name='client.cinder-backup', |
| 161 | path='/etc/ceph/ceph.client.cinder-backup.keyring', |
| 162 | # devstack appears to just want root:root |
| 163 | #owner='cinder:cinder', |
| 164 | ), |
| 165 | ] |
| 166 | for key_dict in keys: |
| 167 | copy_key(ceph_node, key_dict['name'], devstack_node, |
| 168 | key_dict['path'], key_dict.get('owner')) |
| 169 | |
| 170 | |
| 171 | def set_libvirt_secret(devstack_node, ceph_node): |
no test coverage detected