diff options
| author | Mathias Ewald <mewald@evoila.de> | 2016-07-13 10:00:27 +0000 |
|---|---|---|
| committer | Mathias Ewald <mewald@evoila.de> | 2016-07-14 14:05:34 +0000 |
| commit | f16a45180c1d0a5e550c8f9f06fd341881471c97 (patch) | |
| tree | 68dfd5bd9bfbd8c8019d55a5edb6b2bc14a0f35c /docker | |
| parent | 27f1cad74f84e4ac32267328b7bd3d5edb6bc6f5 (diff) | |
| download | kolla-f16a45180c1d0a5e550c8f9f06fd341881471c97.tar.gz kolla-f16a45180c1d0a5e550c8f9f06fd341881471c97.zip | |
External Ceph support - Implementation Glance
Most simple implementation of external ceph support.
We use INI merge to configure RBD backend for Glance and copy
ceph.conf and keyring provided by the user into the container.
Set_configs.py had to be extended to support globbing (wildcards) in
order to copy ceph keyring file which is named depending on the cephx
user name.
Partially-Implements Blueprint: external-ceph
Partially-Implements Blueprint: selectable-ceph
Change-Id: Iacadbd8ec9956e9f075206ea03b28f044cb6ffb8
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/base/set_configs.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/docker/base/set_configs.py b/docker/base/set_configs.py index fd22a3155..94bf24a6b 100644 --- a/docker/base/set_configs.py +++ b/docker/base/set_configs.py @@ -13,6 +13,7 @@ # limitations under the License. import argparse +import glob import json import logging import os @@ -45,15 +46,15 @@ def validate_config(config): def validate_source(data): source = data.get('source') - exists = os.path.exists(source) - - if not exists: - if data.get('optional'): - LOG.info("%s does not exist, but is not required", source) - return False - else: - LOG.error("The source to copy does not exist: %s", source) - sys.exit(1) + # Only check existance if no wildcard found + if '*' not in source: + if not os.path.exists(source): + if data.get('optional'): + LOG.info("%s does not exist, but is not required", source) + return False + else: + LOG.error("The source to copy does not exist: %s", source) + sys.exit(1) return True @@ -82,8 +83,9 @@ def copy_files(data): if source != source_path: # Source is file - LOG.info("Copying %s to %s", source, dest) - shutil.copy(source, dest) + for file in glob.glob(source): + LOG.info("Copying %s to %s", file, dest) + shutil.copy(file, dest) else: # Source is a directory for src in os.listdir(source_path): |
