Commit 4ff922a2 authored by Iustin Pop's avatar Iustin Pop
Browse files

Rename OpExportInstance and LUExportInstance


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent a703bf43
......@@ -329,7 +329,7 @@ Workflow
- The destination cluster generates another key and certificate,
signs and sends it to the third party, who will have to pass it to
the API for exporting an instance (``OpExportInstance``). This
the API for exporting an instance (``OpBackupExport``). This
certificate is used to ensure we're sending the disk data to the
correct destination cluster.
- Once a disk can be imported, the API sends the destination
......@@ -340,7 +340,7 @@ Workflow
together with all necessary information to source cluster and tells
it to start the move
- The existing API for exporting instances (``OpExportInstance``)
- The existing API for exporting instances (``OpBackupExport``)
will be extended to export instances to remote clusters.
#. Source cluster connects to destination cluster for each disk and
......
#
#
# Copyright (C) 2006, 2007, 2010 Google Inc.
# Copyright (C) 2006, 2007, 2010, 2011 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
......@@ -76,12 +76,12 @@ def ExportInstance(opts, args):
raise errors.OpPrereqError("Target node must be specified",
errors.ECODE_INVAL)
op = opcodes.OpExportInstance(instance_name=args[0],
target_node=opts.node,
shutdown=opts.shutdown,
shutdown_timeout=opts.shutdown_timeout,
remove_instance=opts.remove_instance,
ignore_remove_failures=ignore_remove_failures)
op = opcodes.OpBackupExport(instance_name=args[0],
target_node=opts.node,
shutdown=opts.shutdown,
shutdown_timeout=opts.shutdown_timeout,
remove_instance=opts.remove_instance,
ignore_remove_failures=ignore_remove_failures)
SubmitOpCode(op, opts=opts)
return 0
......
......@@ -9581,7 +9581,7 @@ class LUPrepareExport(NoHooksLU):
return None
class LUExportInstance(LogicalUnit):
class LUBackupExport(LogicalUnit):
"""Export an instance to an image in the cluster.
"""
......
......@@ -1113,7 +1113,7 @@ class OpPrepareExport(OpCode):
]
class OpExportInstance(OpCode):
class OpBackupExport(OpCode):
"""Export an instance.
For local exports, the export destination is the node name. For remote
......
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010 Google Inc.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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
......@@ -1163,7 +1163,7 @@ class R_2_instances_name_prepare_export(baserlib.R_Generic):
def _ParseExportInstanceRequest(name, data):
"""Parses a request for an instance export.
@rtype: L{opcodes.OpExportInstance}
@rtype: L{opcodes.OpBackupExport}
@return: Instance export opcode
"""
......@@ -1177,13 +1177,13 @@ def _ParseExportInstanceRequest(name, data):
destination_x509_ca = baserlib.CheckParameter(data, "destination_x509_ca",
default=None)
return opcodes.OpExportInstance(instance_name=name,
mode=mode,
target_node=target_node,
shutdown=shutdown,
remove_instance=remove_instance,
x509_key_name=x509_key_name,
destination_x509_ca=destination_x509_ca)
return opcodes.OpBackupExport(instance_name=name,
mode=mode,
target_node=target_node,
shutdown=shutdown,
remove_instance=remove_instance,
x509_key_name=x509_key_name,
destination_x509_ca=destination_x509_ca)
class R_2_instances_name_export(baserlib.R_Generic):
......
......@@ -196,7 +196,7 @@ class TestParseExportInstanceRequest(testutils.GanetiTestCase):
"destination_x509_ca": ("x", "y", "z"),
}
op = self.Parse(name, data)
self.assert_(isinstance(op, opcodes.OpExportInstance))
self.assert_(isinstance(op, opcodes.OpBackupExport))
self.assertEqual(op.instance_name, name)
self.assertEqual(op.mode, constants.EXPORT_MODE_REMOTE)
self.assertEqual(op.shutdown, True)
......@@ -211,7 +211,7 @@ class TestParseExportInstanceRequest(testutils.GanetiTestCase):
"shutdown": False,
}
op = self.Parse(name, data)
self.assert_(isinstance(op, opcodes.OpExportInstance))
self.assert_(isinstance(op, opcodes.OpBackupExport))
self.assertEqual(op.instance_name, name)
self.assertEqual(op.mode, constants.EXPORT_MODE_LOCAL)
self.assertEqual(op.remove_instance, False)
......
#!/usr/bin/python
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010 Google Inc.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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
......@@ -711,10 +711,10 @@ class Burner(object):
import_log_msg = ("import from %s to %s, %s" %
(enode, pnode, snode))
exp_op = opcodes.OpExportInstance(instance_name=instance,
target_node=enode,
mode=constants.EXPORT_MODE_LOCAL,
shutdown=True)
exp_op = opcodes.OpBackupExport(instance_name=instance,
target_node=enode,
mode=constants.EXPORT_MODE_LOCAL,
shutdown=True)
rem_op = opcodes.OpRemoveInstance(instance_name=instance,
ignore_failures=True)
imp_dir = utils.PathJoin(constants.EXPORT_DIR, full_name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment