[virt-tools-list] [virt-manager PATCH] test: fix a pylint
Chen Hanxiao
chenhanxiao at cn.fujitsu.com
Thu Apr 10 05:46:30 UTC 2014
After commit 7594cef35fbf4c9e535a19bb6cc4f72c24e64116,
pylint show a "access to a protected member" warning.
This patch introduces a static method to solve it.
Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
tests/capabilities.py | 2 +-
virtinst/capabilities.py | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/capabilities.py b/tests/capabilities.py
index 8c18993..394d6ed 100644
--- a/tests/capabilities.py
+++ b/tests/capabilities.py
@@ -222,7 +222,7 @@ class TestCapabilities(unittest.TestCase):
test_utils(new_caps_no_kvm, False, True, False, False, False)
def testCPUMap(self):
- _CPUMapFileValues._cpu_filename = "tests/capabilities-xml/cpu_map.xml"
+ _CPUMapFileValues.update_cpu_filename("tests/capabilities-xml/cpu_map.xml")
caps = self._buildCaps("libvirt-0.7.6-qemu-caps.xml")
cpu_64 = caps.get_cpu_values(None, "x86_64")
cpu_32 = caps.get_cpu_values(None, "i486")
diff --git a/virtinst/capabilities.py b/virtinst/capabilities.py
index 6955ec9..aadb160 100644
--- a/virtinst/capabilities.py
+++ b/virtinst/capabilities.py
@@ -113,6 +113,10 @@ class _CPUMapFileValues(_CPUAPIValues):
self._parseXML,
RuntimeError)
+ @staticmethod
+ def update_cpu_filename(name):
+ _CPUMapFileValues._cpu_filename = name
+
def _parseXML(self, node):
child = node.children
while child:
--
1.8.5.3
More information about the virt-tools-list
mailing list