#
#
-# Copyright (C) 2011 Google Inc.
+# Copyright (C) 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
import ganeti.rapi.rlib2 # pylint: disable=W0611
-COMMON_PARAM_NAMES = map(compat.fst, opcodes.OpCode.OP_PARAMS)
+def _GetCommonParamNames():
+ """Builds a list of parameters common to all opcodes.
+
+ """
+ names = set(map(compat.fst, opcodes.OpCode.OP_PARAMS))
+
+ # The "depends" attribute should be listed
+ names.remove(opcodes.DEPEND_ATTR)
+
+ return names
+
+
+COMMON_PARAM_NAMES = _GetCommonParamNames()
#: Namespace for evaluating expressions
EVAL_NS = dict(compat=compat, constants=constants, utils=utils, errors=errors,
defs = [(fdef.name, fdef.doc)
for (_, (fdef, _, _, _)) in utils.NiceSort(fields.items(),
key=compat.fst)]
- yield BuildValuesDoc(defs)
+ return BuildValuesDoc(defs)
def BuildValuesDoc(values):