Revision 3eccac06
b/daemons/ganeti-noded | ||
---|---|---|
310 | 310 |
|
311 | 311 |
""" |
312 | 312 |
path = params[0] |
313 |
einfo = backend.ExportInfo(path) |
|
314 |
if einfo is None: |
|
315 |
return einfo |
|
316 |
return einfo.Dumps() |
|
313 |
return backend.ExportInfo(path) |
|
317 | 314 |
|
318 | 315 |
@staticmethod |
319 | 316 |
def perspective_export_list(params): |
b/lib/backend.py | ||
---|---|---|
1900 | 1900 |
|
1901 | 1901 |
if (not config.has_section(constants.INISECT_EXP) or |
1902 | 1902 |
not config.has_section(constants.INISECT_INS)): |
1903 |
return None
|
|
1903 |
_Fail("Export info file doesn't have the required fields")
|
|
1904 | 1904 |
|
1905 |
return config
|
|
1905 |
return True, config.Dumps()
|
|
1906 | 1906 |
|
1907 | 1907 |
|
1908 | 1908 |
def ImportOSIntoInstance(instance, src_node, src_images, cluster_name): |
b/lib/cmdlib.py | ||
---|---|---|
4688 | 4688 |
|
4689 | 4689 |
_CheckNodeOnline(self, src_node) |
4690 | 4690 |
result = self.rpc.call_export_info(src_node, src_path) |
4691 |
result.Raise() |
|
4692 |
if not result.data: |
|
4693 |
raise errors.OpPrereqError("No export found in dir %s" % src_path) |
|
4691 |
msg = result.RemoteFailMsg() |
|
4692 |
if msg: |
|
4693 |
raise errors.OpPrereqError("No export or invalid export found in" |
|
4694 |
" dir %s: %s" % (src_path, msg)) |
|
4694 | 4695 |
|
4695 |
export_info = result.data
|
|
4696 |
export_info = objects.SerializableConfigParser.Loads(str(result.payload))
|
|
4696 | 4697 |
if not export_info.has_section(constants.INISECT_EXP): |
4697 | 4698 |
raise errors.ProgrammerError("Corrupted export config") |
4698 | 4699 |
|
b/lib/rpc.py | ||
---|---|---|
974 | 974 |
This is a single-node call. |
975 | 975 |
|
976 | 976 |
""" |
977 |
result = self._SingleNodeCall(node, "export_info", [path]) |
|
978 |
if not result.failed and result.data: |
|
979 |
result.data = objects.SerializableConfigParser.Loads(str(result.data)) |
|
980 |
return result |
|
977 |
return self._SingleNodeCall(node, "export_info", [path]) |
|
981 | 978 |
|
982 | 979 |
def call_instance_os_import(self, node, inst, src_node, src_images, |
983 | 980 |
cluster_name): |
Also available in: Unified diff