Fix for kolla/etc copy in setup script

The cli_setup copy was creating an extra kolla directory on the copy-
/etc/kolla/kolla, instead of just /etc/kolla.

Also in utils, improved the error message when you don't have permissions
on getting a lock.

Change-Id: I7ee60c3203c4fe4a8222fd65cf8ef96414f15eb6
This commit is contained in:
Steve Noyes 2018-06-11 16:56:16 -04:00
parent 4e26ee0c40
commit 30dd6d7533
2 changed files with 12 additions and 9 deletions

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python
#
# Copyright 2018 OpenStack Foundation
# All Rights Reserved.
#
@ -44,8 +46,8 @@ def setup_ansible_etc():
# copy over all kolla ansible etc files
kolla_ansible_etc_source = os.path.join(kolla_ansible_source_base,
'etc', kolla)
copy_kolla_etc_files_cmd = ('cp -a %s %s' % (kolla_ansible_etc_source,
kolla_ansible_etc_target))
copy_kolla_etc_files_cmd = ('cp -a %s/* %s' % (kolla_ansible_etc_source,
kolla_ansible_etc_target))
_command_exec(copy_kolla_etc_files_cmd)

View File

@ -541,15 +541,16 @@ class Lock(object):
return self._acquire_flock()
else:
return self._acquire_pidfile()
except Exception as e:
if not os.path.exists(self.lockpath):
raise Exception('Lock file (%s) is missing'
% self.lockpath)
# it is ok to fail to acquire, we just return that we failed
LOG.debug('Exception in acquire lock. '
except IOError as e:
# IOError is the error you get when the file is
# already locked. (No such file returns an OSError.)
# This may be OK and is handled by the caller.
LOG.debug('Exception in acquiring lock. '
'path: %s pid: %s owner: %s error: %s' %
(self.lockpath, self.pid, self.owner, str(e)))
return False
except Exception as e:
raise e
def _acquire_pidfile(self):
if not self.is_owned_by_me():