diff options
| author | Zuul <zuul@review.openstack.org> | 2018-10-29 13:55:35 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2018-10-29 13:55:35 +0000 |
| commit | 6f457e1fcbfc30df887265ad5358dfc5c0200da4 (patch) | |
| tree | f2001d39fb4dc13e2422989abfe1225911994b41 | |
| parent | 6a87e5bbd785a92562f6c58a10a278b038167a2d (diff) | |
| parent | 5792c1d7b44737f1f39bb1a81b0c95207ad087ad (diff) | |
| download | kolla-6f457e1fcbfc30df887265ad5358dfc5c0200da4.tar.gz kolla-6f457e1fcbfc30df887265ad5358dfc5c0200da4.zip | |
Merge "build: remove link to failed log before creating"
| -rwxr-xr-x | kolla/image/build.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kolla/image/build.py b/kolla/image/build.py index 9b41dd3a6..a2c1ecc86 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -1032,9 +1032,15 @@ class KollaWorker(object): 'status': status, }) if self.conf.logs_dir and status == STATUS_ERROR: - os.symlink("%s.log" % name, - os.path.join(self.conf.logs_dir, - "000_FAILED_%s.log" % name)) + linkname = os.path.join(self.conf.logs_dir, + "000_FAILED_%s.log" % name) + try: + os.lstat(linkname) + os.remove(linkname) + except OSError: + pass + + os.symlink("%s.log" % name, linkname) if self.image_statuses_unmatched: LOG.debug("=====================================") |
