Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into log_tool
Browse files Browse the repository at this point in the history
  • Loading branch information
pgombar committed Sep 9, 2020
2 parents 49e7ca9 + 9a25e21 commit c883d9e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
6 changes: 3 additions & 3 deletions azurelinuxagent/common/logcollector.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def _process_manifest_file(self):
if len(contents) != 2:
# If it's not a comment or an empty line, it's a malformed entry
if not entry.startswith("#") and len(entry.strip()) > 0: # pylint: disable=len-as-condition
_LOGGER.error("Couldn't parse \"{0}\"".format(entry)) # pylint: disable=W1202
_LOGGER.error("Couldn't parse \"%s\"", entry)
continue

command, value = contents
Expand All @@ -242,7 +242,7 @@ def _truncate_large_file(file_path):
# Binary files cannot be truncated, don't include large binary files
ext = os.path.splitext(file_path)[1]
if ext in [".gz", ".zip", ".xz"]:
_LOGGER.warning("Discarding large binary file {0}".format(file_path)) # pylint: disable=W1202
_LOGGER.warning("Discarding large binary file %s", file_path)
return None

truncated_file_path = os.path.join(_TRUNCATED_FILES_DIR, file_path.replace(os.path.sep, "_"))
Expand All @@ -261,7 +261,7 @@ def _truncate_large_file(file_path):

return truncated_file_path
except OSError as e: # pylint: disable=C0103
_LOGGER.error("Failed to truncate large file: {0}".format(ustr(e))) # pylint: disable=W1202
_LOGGER.error("Failed to truncate large file: %s", ustr(e))
return None

def _get_file_priority(self, file_entry):
Expand Down
2 changes: 0 additions & 2 deletions ci/2.7.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# cell-var-from-loop<W0640>: (hi-pri) A variable used in a closure is defined in a loop. This will result in all closures using the same value for the closed-over variable.
# cyclic-import<R0401>: (hi-pri) Used when a cyclic import between two or more modules is detected.
# dangerous-default-value<W0102>: (hi-pri) Used when a mutable value as list or dictionary is detected in a default value for an argument.
# duplicate-key<W0109>: (hi-pri) Used when a dictionary expression binds the same key multiple times.
# expression-not-assigned<W0106>: (hi-pri) Used when an expression that is not a function call is assigned to nothing.
# duplicate-code<R0801>: (hi-pri) Indicates that a set of similar lines has been detected among multiple file. (also disabled globally)
# fixme<W0511>: Used when a warning note as FIXME or TODO is detected
Expand All @@ -24,7 +23,6 @@
# invalid-name<C0103>: (needs review) Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
# keyword-arg-before-vararg<W1113>: (hi-pri) When defining a keyword argument before variable positional arguments, one can end up in having multiple values passed for the aforementioned parameter in case the method is called with keyword arguments.
# len-as-condition<C1801>: (hi-pri) Used when Pylint detects that len(sequence) is being used without explicit comparison inside a condition to determine if a sequence is empty.
# logging-format-interpolation<W1202>: (hi-pri) Used when a logging statement has a call form of "logging.<logging method>(format_string.format(format_args...))". Use another type of string formatting instead.
# multiple-imports<C0410>: (hi-pri) Used when import statement importing multiple modules is detected.
# no-else-return<R1705>: (hi-pri) Used in order to highlight an unnecessary block of code following an if containing a return statement.
# no-member<E1101>: (hi-pri) Used when a variable is accessed for an unexistent member.
Expand Down
2 changes: 0 additions & 2 deletions ci/3.6.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# consider-using-in<R1714>: To check if a variable is equal to one of many values,combine the values into a tuple and check if the variable is contained "in" it instead of checking for equality against each of the values.
# cyclic-import<R0401>: (hi-pri) Used when a cyclic import between two or more modules is detected.
# dangerous-default-value<W0102>: (hi-pri) Used when a mutable value as list or dictionary is detected in a default value for an argument.
# duplicate-key<W0109>: (hi-pri) Used when a dictionary expression binds the same key multiple times.
# duplicate-code<R0801>: (hi-pri) Indicates that a set of similar lines has been detected among multiple file. (also disabled globally)
# duplicate-string-formatting-argument<W1308>: (hi-pri) Used when we detect that a string formatting is repeating an argument instead of using named string arguments
# expression-not-assigned<W0106>: (hi-pri) Used when an expression that is not a function call is assigned to nothing.
Expand All @@ -30,7 +29,6 @@
# invalid-name<C0103>: (needs review) Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
# keyword-arg-before-vararg<W1113>: (hi-pri) When defining a keyword argument before variable positional arguments, one can end up in having multiple values passed for the aforementioned parameter in case the method is called with keyword arguments.
# len-as-condition<C1801>: (hi-pri) Used when Pylint detects that len(sequence) is being used without explicit comparison inside a condition to determine if a sequence is empty.
# logging-format-interpolation<W1202>: (hi-pri) Used when a logging statement has a call form of "logging.<logging method>(format_string.format(format_args...))". Use another type of string formatting instead.
# multiple-imports<C0410>: (hi-pri) Used when import statement importing multiple modules is detected.
# lost-exception<W0150>: (needs review) Used when a break or a return statement is found inside the finally clause of a try...finally block: the exceptions raised in the try clause will be silently swallowed instead of being re-raised.
# no-else-break<R1723>: (hi-pri) Used in order to highlight an unnecessary block of code following an if containing a break statement.
Expand Down
8 changes: 1 addition & 7 deletions tests/utils/test_flexible_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_compile_pattern(self): # pylint: disable=useless-return
def test_compile_pattern_sep(self): # pylint: disable=useless-return
self.v.sep = '-'
self.v._compile_pattern() # pylint: disable=protected-access
tests = { # pylint: disable=duplicate-key
tests = {
'1': True,
'1-2': True,
'1-2-3': True,
Expand All @@ -97,10 +97,8 @@ def test_compile_pattern_sep(self): # pylint: disable=useless-return

'1alpha': True,
'1-alpha': True,
'1-alpha': True,
'1alpha0': True,
'1-alpha0': True,
'1-alpha0': True,
'1-2alpha': True,
'1-2.alpha': True,
'1-2-alpha': True,
Expand All @@ -110,10 +108,8 @@ def test_compile_pattern_sep(self): # pylint: disable=useless-return

'1beta': True,
'1-beta': True,
'1-beta': True,
'1beta0': True,
'1-beta0': True,
'1-beta0': True,
'1-2beta': True,
'1-2.beta': True,
'1-2-beta': True,
Expand All @@ -123,10 +119,8 @@ def test_compile_pattern_sep(self): # pylint: disable=useless-return

'1rc': True,
'1-rc': True,
'1-rc': True,
'1rc0': True,
'1-rc0': True,
'1-rc0': True,
'1-2rc': True,
'1-2.rc': True,
'1-2-rc': True,
Expand Down

0 comments on commit c883d9e

Please sign in to comment.