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)
|
self._groupnames.remove(groupname)
|
||||||
|
|
||||||
def set_groupnames(self, groupnames):
|
def set_groupnames(self, groupnames):
|
||||||
self._groupnames = groupnames
|
self._groupnames = groupnames
|
||||||
|
|
||||||
def get_groupnames(self):
|
def get_groupnames(self):
|
||||||
return copy(self._groupnames)
|
return copy(self._groupnames)
|
||||||
|
|
|
@ -554,21 +554,21 @@ class Lock(object):
|
||||||
return os.path.join(get_kolla_cli_home(), 'ansible.lock')
|
return os.path.join(get_kolla_cli_home(), 'ansible.lock')
|
||||||
|
|
||||||
def acquire(self):
|
def acquire(self):
|
||||||
try:
|
try:
|
||||||
if self.use_flock:
|
if self.use_flock:
|
||||||
return self._acquire_flock()
|
return self._acquire_flock()
|
||||||
else:
|
else:
|
||||||
return self._acquire_pidfile()
|
return self._acquire_pidfile()
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
# IOError is the error you get when the file is
|
# IOError is the error you get when the file is
|
||||||
# already locked. (No such file returns an OSError.)
|
# already locked. (No such file returns an OSError.)
|
||||||
# This may be OK and is handled by the caller.
|
# This may be OK and is handled by the caller.
|
||||||
LOG.debug('Exception in acquiring lock. '
|
LOG.debug('Exception in acquiring lock. '
|
||||||
'path: %s pid: %s owner: %s error: %s' %
|
'path: %s pid: %s owner: %s error: %s' %
|
||||||
(self.lockpath, self.pid, self.owner, str(e)))
|
(self.lockpath, self.pid, self.owner, str(e)))
|
||||||
return False
|
return False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
def _acquire_pidfile(self):
|
def _acquire_pidfile(self):
|
||||||
if not self.is_owned_by_me():
|
if not self.is_owned_by_me():
|
||||||
|
|
|
@ -237,5 +237,6 @@ def main():
|
||||||
else:
|
else:
|
||||||
raise Exception('Invalid command %s' % command)
|
raise Exception('Invalid command %s' % command)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -112,5 +112,6 @@ def main():
|
||||||
|
|
||||||
print('Log collection complete. Logs are at %s' % tar_path)
|
print('Log collection complete. Logs are at %s' % tar_path)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in New Issue