Add constants for the reason trail implementation
authorMichele Tartara <mtartara@google.com>
Mon, 25 Mar 2013 14:11:31 +0000 (15:11 +0100)
committerMichele Tartara <mtartara@google.com>
Mon, 22 Apr 2013 11:10:39 +0000 (11:10 +0000)
A few constants are required, describing the source reason of the opcode.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

lib/constants.py

index 50b11ba..e439ea8 100644 (file)
@@ -2435,5 +2435,23 @@ AUTO_REPAIR_ALL_RESULTS = frozenset([
 # The version identifier for builtin data collectors
 BUILTIN_DATA_COLLECTOR_VERSION = "B"
 
+# The reason trail opcode parameter name
+OPCODE_REASON = "reason"
+
+# The source reasons for the execution of an OpCode
+OPCODE_REASON_SRC_CLIENT = "gnt:client"
+OPCODE_REASON_SRC_NODED = "gnt:daemon:noded"
+OPCODE_REASON_SRC_OPCODE = "gnt:opcode"
+OPCODE_REASON_SRC_RLIB2 = "gnt:library:rlib2"
+OPCODE_REASON_SRC_USER = "gnt:user"
+
+OPCODE_REASON_SOURCES = compat.UniqueFrozenset([
+  OPCODE_REASON_SRC_CLIENT,
+  OPCODE_REASON_SRC_NODED,
+  OPCODE_REASON_SRC_OPCODE,
+  OPCODE_REASON_SRC_RLIB2,
+  OPCODE_REASON_SRC_USER,
+  ])
+
 # Do not re-export imported modules
 del re, _vcsversion, _autoconf, socket, pathutils, compat