summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-01-31 13:00:25 +0100
committerMichal Minar <miminar@redhat.com>2013-01-31 13:00:25 +0100
commit2e865c410df8373c8acbc5ca2f32e0a69bfa1762 (patch)
tree2cd9cc453f8183b0070a7672c0b1aa985f696b54 /tools
parentb2044c554f4343abaa31f843fdc6b8a445cbff96 (diff)
downloadopenlmi-providers-2e865c410df8373c8acbc5ca2f32e0a69bfa1762.tar.gz
openlmi-providers-2e865c410df8373c8acbc5ca2f32e0a69bfa1762.tar.xz
openlmi-providers-2e865c410df8373c8acbc5ca2f32e0a69bfa1762.zip
fixed pylint plugin
pylintlmi could raise an attribute error, when checking module name
Diffstat (limited to 'tools')
-rw-r--r--tools/pylint/plugins/cim_provider_checker.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/pylint/plugins/cim_provider_checker.py b/tools/pylint/plugins/cim_provider_checker.py
index cf4e229..8ce775b 100644
--- a/tools/pylint/plugins/cim_provider_checker.py
+++ b/tools/pylint/plugins/cim_provider_checker.py
@@ -79,6 +79,7 @@ def supress_cim_provider_messages(linter, node):
or ( child.name not in generated_methods
and not child.name.startswith('cim_method_'))):
continue
+ linter.disable('R0201', scope='module', line=node.lineno)
for arg in child.args.get_children():
linter.disable('W0613', scope='module', line=arg.lineno)
@@ -128,7 +129,7 @@ class CIMProviderChecker(BaseChecker):
modm = _RE_PROVIDER_MODULE_NAME.match(parent.name)
if clsm and not modm:
self.add_message('C9905', node=node, args=parent.name)
- if clsm and clsm.group('prefix') != modm.group('prefix'):
+ if clsm and modm and clsm.group('prefix') != modm.group('prefix'):
self.add_message('C9906', node=node,
args=(modm.group('prefix'), clsm.group('prefix')))
if clsm and clsm.group('prefix') != 'LMI':
@@ -146,6 +147,9 @@ class CIMProviderChecker(BaseChecker):
if not node.name in [i[0].value for i in dictionary.items]:
self.add_message('W9909', node=getprovs, args=node.name)
+ elif node.name == "Values" and len([a for a in node.ancestors()]) == 1:
+ recursively_clean_cls_values(self.linter, node)
+
def visit_module(self, node):
"""
Check for invalid module name.