2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-02 15:25:22 +00:00

python: Resolve some indentation warnings.

This patch resolves the following warnings from flake8:

 E111 indentation is not a multiple of four
 E112 expected an indented block
 E113 unexpected indentation

It's critical to have correct indentation in Python code, so it seemed
worth enabling these warnings.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Russell Bryant
2016-01-05 14:50:40 -05:00
parent f7f7fcced5
commit eda26d40ae
5 changed files with 43 additions and 42 deletions

View File

@@ -342,9 +342,6 @@ endif
if HAVE_FLAKE8 if HAVE_FLAKE8
ALL_LOCAL += flake8-check ALL_LOCAL += flake8-check
# E111 indentation is not a multiple of four
# E112 expected an indented block
# E113 unexpected indentation
# E123 closing bracket does not match indentation of opening bracket's line # E123 closing bracket does not match indentation of opening bracket's line
# E126 continuation line over-indented for hanging indent # E126 continuation line over-indented for hanging indent
# E127 continuation line over-indented for visual indent # E127 continuation line over-indented for visual indent
@@ -353,7 +350,7 @@ ALL_LOCAL += flake8-check
# E131 continuation line unaligned for hanging indent # E131 continuation line unaligned for hanging indent
# E501 line too long (80 > 79 characters) # E501 line too long (80 > 79 characters)
flake8-check: $(FLAKE8_PYFILES) flake8-check: $(FLAKE8_PYFILES)
$(AM_V_GEN) if flake8 $^ --ignore=E111,E112,E113,E123,E126,E127,E128,E129,E131,E501 ${FLAKE8_FLAGS}; then touch $@; else exit 1; fi $(AM_V_GEN) if flake8 $^ --ignore=E123,E126,E127,E128,E129,E131,E501 ${FLAKE8_FLAGS}; then touch $@; else exit 1; fi
endif endif
include $(srcdir)/manpages.mk include $(srcdir)/manpages.mk

View File

@@ -111,7 +111,6 @@ The following options are also available:
sys.exit(0) sys.exit(0)
if __name__ == '__main__': if __name__ == '__main__':
# try:
try: try:
options, args = getopt.gnu_getopt(sys.argv[1:], 'hV', options, args = getopt.gnu_getopt(sys.argv[1:], 'hV',
['help', 'version']) ['help', 'version'])
@@ -134,10 +133,6 @@ if __name__ == '__main__':
print_ipfix_entity_macros(args[0]) print_ipfix_entity_macros(args[0])
# except Exception, e:
# sys.stderr.write('%s: %s\n' % (sys.argv[0], e))
# sys.exit(1)
# Local variables: # Local variables:
# mode: python # mode: python
# End: # End:

View File

@@ -749,17 +749,26 @@ class Transaction(object):
of Idl.change_seqno. (Transaction.commit_block() calls Idl.run().)""" of Idl.change_seqno. (Transaction.commit_block() calls Idl.run().)"""
# Status values that Transaction.commit() can return. # Status values that Transaction.commit() can return.
UNCOMMITTED = "uncommitted" # Not yet committed or aborted.
UNCHANGED = "unchanged" # Transaction didn't include any changes. # Not yet committed or aborted.
INCOMPLETE = "incomplete" # Commit in progress, please wait. UNCOMMITTED = "uncommitted"
ABORTED = "aborted" # ovsdb_idl_txn_abort() called. # Transaction didn't include any changes.
SUCCESS = "success" # Commit successful. UNCHANGED = "unchanged"
TRY_AGAIN = "try again" # Commit failed because a "verify" operation # Commit in progress, please wait.
INCOMPLETE = "incomplete"
# ovsdb_idl_txn_abort() called.
ABORTED = "aborted"
# Commit successful.
SUCCESS = "success"
# Commit failed because a "verify" operation
# reported an inconsistency, due to a network # reported an inconsistency, due to a network
# problem, or other transient failure. Wait # problem, or other transient failure. Wait
# for a change, then try again. # for a change, then try again.
NOT_LOCKED = "not locked" # Server hasn't given us the lock yet. TRY_AGAIN = "try again"
ERROR = "error" # Commit failed due to a hard error. # Server hasn't given us the lock yet.
NOT_LOCKED = "not locked"
# Commit failed due to a hard error.
ERROR = "error"
@staticmethod @staticmethod
def status_to_string(status): def status_to_string(status):