"_OPCODE_ATTRS" will also be used in the Sphinx extension.
---
lib/rapi/baserlib.py | 6 +++---
test/py/ganeti.rapi.baserlib_unittest.py | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/rapi/baserlib.py b/lib/rapi/baserlib.py
index b71e767..03ac62d 100644
--- a/lib/rapi/baserlib.py
+++ b/lib/rapi/baserlib.py
@@ -59,7 +59,7 @@ def _BuildOpcodeAttributes():
for method in _SUPPORTED_METHODS]
-_OPCODE_ATTRS = _BuildOpcodeAttributes()
+OPCODE_ATTRS = _BuildOpcodeAttributes()
def BuildUriList(ids, uri_format, uri_fields=("name", "uri")):
@@ -403,7 +403,7 @@ def GetResourceOpcodes(cls):
"""
return frozenset(filter(None, (getattr(cls, op_attr, None)
- for (_, op_attr, _, _) in _OPCODE_ATTRS)))
+ for (_, op_attr, _, _) in OPCODE_ATTRS)))
def GetHandlerAccess(handler, method):
@@ -428,7 +428,7 @@ class _MetaOpcodeResource(type):
# Access to private attributes of a client class, pylint: disable=W0212
obj = type.__call__(mcs, *args, **kwargs)
- for (method, op_attr, rename_attr, fn_attr) in _OPCODE_ATTRS:
+ for (method, op_attr, rename_attr, fn_attr) in OPCODE_ATTRS:
if hasattr(obj, method):
# If the method handler is already defined, "*_RENAME" or "Get*OpInput"
# shouldn't be (they're only used by the automatically generated
diff --git a/test/py/ganeti.rapi.baserlib_unittest.py
b/test/py/ganeti.rapi.baserlib_unittest.py
index 0582cb7..00c9678 100755
--- a/test/py/ganeti.rapi.baserlib_unittest.py
+++ b/test/py/ganeti.rapi.baserlib_unittest.py
@@ -109,14 +109,14 @@ class TestOpcodeResource(unittest.TestCase):
attrs = ["%s_OPCODE" % method, "%s_RENAME" % method,
"Get%sOpInput" % method.capitalize()]
assert attrs == dict((opattrs[0], list(opattrs[1:]))
- for opattrs in baserlib._OPCODE_ATTRS)[method]
+ for opattrs in baserlib.OPCODE_ATTRS)[method]
return attrs
def test(self):
for method in baserlib._SUPPORTED_METHODS:
# Empty handler
obj = self._MakeClass(method, {})(None, None, None)
- for attr in itertools.chain(*baserlib._OPCODE_ATTRS):
+ for attr in itertools.chain(*baserlib.OPCODE_ATTRS):
self.assertFalse(hasattr(obj, attr))
# Direct handler function
@@ -153,7 +153,7 @@ class TestOpcodeResource(unittest.TestCase):
obj = _Empty(None, None, None)
- for attr in itertools.chain(*baserlib._OPCODE_ATTRS):
+ for attr in itertools.chain(*baserlib.OPCODE_ATTRS):
self.assertFalse(hasattr(obj, attr))
--
1.8.1