Skip to content
Snippets Groups Projects
Commit 9fdc92fa authored by Guido Trotter's avatar Guido Trotter
Browse files

burnin: rename instances to same name


this (a) allows us to test renaming in burnin even if we don't have an
extra instance name and (b) is a valid operation, as it allows to "fix"
an instance who went name-astray

Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 57fb6fcb
No related branches found
No related tags found
No related merge requests found
...@@ -171,6 +171,9 @@ OPTIONS = [ ...@@ -171,6 +171,9 @@ OPTIONS = [
cli.cli_option("--no-reboot", dest="do_reboot", cli.cli_option("--no-reboot", dest="do_reboot",
help="Skip instance reboot", action="store_false", help="Skip instance reboot", action="store_false",
default=True), default=True),
cli.cli_option("--no-renamesame", dest="do_renamesame",
help="Skip instance rename to same name", action="store_false",
default=True),
cli.cli_option("--reboot-types", dest="reboot_types", cli.cli_option("--reboot-types", dest="reboot_types",
help="Specify the reboot types", default=None), help="Specify the reboot types", default=None),
cli.cli_option("--no-activate-disks", dest="do_activate_disks", cli.cli_option("--no-activate-disks", dest="do_activate_disks",
...@@ -870,6 +873,19 @@ class Burner(object): ...@@ -870,6 +873,19 @@ class Burner(object):
ops.append(op) ops.append(op)
self.ExecOrQueue(instance, ops) self.ExecOrQueue(instance, ops)
@_DoCheckInstances
@_DoBatch(True)
def BurnRenameSame(self):
"""Rename the instances to their own name."""
Log("Renaming the instances to their own name")
for instance in self.instances:
Log("instance %s", instance, indent=1)
op1 = self.StopInstanceOp(instance)
op2 = self.RenameInstanceOp(instance, instance)
Log("rename to the same name", indent=2)
op4 = self.StartInstanceOp(instance)
self.ExecOrQueue(instance, [op1, op2, op4])
@_DoCheckInstances @_DoCheckInstances
@_DoBatch(True) @_DoBatch(True)
def BurnActivateDisks(self): def BurnActivateDisks(self):
...@@ -1074,6 +1090,9 @@ class Burner(object): ...@@ -1074,6 +1090,9 @@ class Burner(object):
if opts.do_reboot: if opts.do_reboot:
self.BurnReboot() self.BurnReboot()
if opts.do_renamesame:
self.BurnRenameSame()
if opts.do_addremove_disks: if opts.do_addremove_disks:
self.BurnAddRemoveDisks() self.BurnAddRemoveDisks()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment