Fix some pep8 failed
1. expected 2 blank lines after class or function definition, found 1 2. E117 over-indented Change-Id: I7ef1a0ffbf200850f350ae6df5fed3ded9b20f90
This commit is contained in:
parent
3f9b0679ab
commit
f87b3fbbb8
|
@ -50,7 +50,7 @@ class Service(object):
|
|||
self._groupnames.remove(groupname)
|
||||
|
||||
def set_groupnames(self, groupnames):
|
||||
self._groupnames = groupnames
|
||||
self._groupnames = groupnames
|
||||
|
||||
def get_groupnames(self):
|
||||
return copy(self._groupnames)
|
||||
|
|
|
@ -554,21 +554,21 @@ class Lock(object):
|
|||
return os.path.join(get_kolla_cli_home(), 'ansible.lock')
|
||||
|
||||
def acquire(self):
|
||||
try:
|
||||
if self.use_flock:
|
||||
return self._acquire_flock()
|
||||
else:
|
||||
return self._acquire_pidfile()
|
||||
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
|
||||
try:
|
||||
if self.use_flock:
|
||||
return self._acquire_flock()
|
||||
else:
|
||||
return self._acquire_pidfile()
|
||||
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():
|
||||
|
|
|
@ -237,5 +237,6 @@ def main():
|
|||
else:
|
||||
raise Exception('Invalid command %s' % command)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -112,5 +112,6 @@ def main():
|
|||
|
||||
print('Log collection complete. Logs are at %s' % tar_path)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue