diff options
| author | Alex Schultz <aschultz@redhat.com> | 2020-01-24 10:18:47 -0700 |
|---|---|---|
| committer | Alex Schultz <aschultz@redhat.com> | 2020-01-24 10:30:03 -0700 |
| commit | 2207afc9b9306c19785238f8f02642187f807785 (patch) | |
| tree | 29f1c46417e8f623a66cae6df56fb570cb8a3100 /docker | |
| parent | db212f92d6f149544d5b2b9c0e88c6b43ff7bcc8 (diff) | |
| download | kolla-2207afc9b9306c19785238f8f02642187f807785.tar.gz kolla-2207afc9b9306c19785238f8f02642187f807785.zip | |
Add error message when merge fails
If the source cfg directory contains a path (e.g.
/etc/pki/ca-trust/extracted/) which is also bind mounted into the
container as read-only, when it attempts to merge the paths together
the resulting exception doesn't really indicate what happened.
Change-Id: I73bbfd31586012e1fd64d30f9ce1d7eb2256d210
Related-Bug: #1860607
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/base/set_configs.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/docker/base/set_configs.py b/docker/base/set_configs.py index 9176a510d..93a758f1d 100644 --- a/docker/base/set_configs.py +++ b/docker/base/set_configs.py @@ -147,7 +147,15 @@ class ConfigFile(object): if not self.merge: self._delete_path(dest) self._create_parent_dirs(dest) - self._merge_directories(source, dest) + try: + self._merge_directories(source, dest) + except OSError: + # If a source is tried to merge with a read-only mount, it + # may throw an OSError. Because we don't print the source or + # dest anywhere, let's catch the exception and log a better + # message to help with tracking down the issue. + LOG.error('Unable to merge %s with %s', source, dest) + raise def _cmp_file(self, source, dest): # check exsit |
