Merge remote branch 'cros/upstream' into autotest-rebase

Merged to upstream trunk@5066, from trunk@4749.

There is no way I could enlist each individual CL from the upstream here since it will blow up the changelist description field.

BUG=
TEST=
Had patched this CL into a fresh cut client to avoid any side effect.
run_remote_test bvt from both emerged location and third_party/autotest/file.

Both test passed!

We should also keep any eye on this to see how it gets propagated into cautotest server.
TBR=dalecurtis

Change-Id: I72f2bc7a9de530178484aea1bfb5ace68bcad029
diff --git a/utils/run_pylint.py b/utils/run_pylint.py
index 0bf5f95..3c3e225 100755
--- a/utils/run_pylint.py
+++ b/utils/run_pylint.py
@@ -6,10 +6,13 @@
 # do a basic check to see if pylint is even installed
 try:
     import pylint
+    from pylint.__pkginfo__ import version as pylint_version
 except ImportError:
     print "Unable to import pylint, it may need to be installed"
     sys.exit(1)
 
+major, minor, release = pylint_version.split('.')
+pylint_version = float("%s.%s" % (major, minor))
 pylintrc_path = os.path.expanduser('~/.pylintrc')
 if not os.path.exists(pylintrc_path):
     open(pylintrc_path, 'w').close()
@@ -54,10 +57,13 @@
 # * common_lib.enum.Enum objects
 # * DB model objects (scheduler models are the worst, but Django models also
 #   generate some errors)
-pylint_base_opts = ['--disable-msg-cat=warning,refactor,convention',
-                    '--disable-msg=E1101,E1103',
-                    '--reports=no',
-                    '--include-ids=y']
+if pylint_version >= 0.21:
+    pylint_base_opts = ['--disable=W,R,C,E1101,E1103']
+else:
+    pylint_base_opts = ['--disable-msg-cat=warning,refactor,convention',
+                        '--disable-msg=E1101,E1103']
+pylint_base_opts += ['--reports=no',
+                     '--include-ids=y']
 
 file_list = sys.argv[1:]
 if '--' in file_list: