Revision 584ea340
b/lib/backend.py | ||
---|---|---|
110 | 110 |
""" |
111 | 111 |
|
112 | 112 |
|
113 |
def GetInstReasonFilename(instance_name): |
|
113 |
def _GetInstReasonFilename(instance_name):
|
|
114 | 114 |
"""Path of the file containing the reason of the instance status change. |
115 | 115 |
|
116 | 116 |
@type instance_name: string |
... | ... | |
122 | 122 |
return utils.PathJoin(pathutils.INSTANCE_REASON_DIR, instance_name) |
123 | 123 |
|
124 | 124 |
|
125 |
def _StoreInstReasonTrail(instance_name, trail): |
|
126 |
"""Serialize a reason trail related to an instance change of state to file. |
|
127 |
|
|
128 |
The exact location of the file depends on the name of the instance and on |
|
129 |
the configuration of the Ganeti cluster defined at deploy time. |
|
130 |
|
|
131 |
@type instance_name: string |
|
132 |
@param instance_name: The name of the instance |
|
133 |
@rtype: None |
|
134 |
|
|
135 |
""" |
|
136 |
json = serializer.DumpJson(trail) |
|
137 |
filename = _GetInstReasonFilename(instance_name) |
|
138 |
utils.WriteFile(filename, data=json) |
|
139 |
|
|
140 |
|
|
125 | 141 |
def _Fail(msg, *args, **kwargs): |
126 | 142 |
"""Log an error and the raise an RPCFail exception. |
127 | 143 |
|
Also available in: Unified diff