Revision 0ccbf925
b/tools/burnin | ||
---|---|---|
1 | 1 |
#!/usr/bin/python |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
905 | 905 |
|
906 | 906 |
@_DoBatch(False) |
907 | 907 |
def BurnAddRemoveNICs(self): |
908 |
"""Add and remove an extra NIC for the instances.""" |
|
908 |
"""Add, change and remove an extra NIC for the instances."""
|
|
909 | 909 |
Log("Adding and removing NICs") |
910 | 910 |
for instance in self.instances: |
911 | 911 |
Log("instance %s", instance, indent=1) |
912 | 912 |
op_add = opcodes.OpInstanceSetParams(\ |
913 | 913 |
instance_name=instance, nics=[(constants.DDM_ADD, {})]) |
914 |
op_chg = opcodes.OpInstanceSetParams(\ |
|
915 |
instance_name=instance, nics=[(constants.DDM_MODIFY, |
|
916 |
-1, {"mac": constants.VALUE_GENERATE})]) |
|
914 | 917 |
op_rem = opcodes.OpInstanceSetParams(\ |
915 | 918 |
instance_name=instance, nics=[(constants.DDM_REMOVE, {})]) |
916 | 919 |
Log("adding a NIC", indent=2) |
920 |
Log("changing a NIC", indent=2) |
|
917 | 921 |
Log("removing last NIC", indent=2) |
918 |
self.ExecOrQueue(instance, [op_add, op_rem]) |
|
922 |
self.ExecOrQueue(instance, [op_add, op_chg, op_rem])
|
|
919 | 923 |
|
920 | 924 |
def ConfdCallback(self, reply): |
921 | 925 |
"""Callback for confd queries""" |
Also available in: Unified diff