Revision 1c573fb4
b/qa/qa_instance.py | ||
---|---|---|
42 | 42 |
return "/sys/block/%s/device/state" % disk |
43 | 43 |
|
44 | 44 |
|
45 |
def _GetGenericAddParameters(inst): |
|
45 |
def _GetGenericAddParameters(inst, force_mac=None):
|
|
46 | 46 |
params = ["-B"] |
47 | 47 |
params.append("%s=%s,%s=%s" % (constants.BE_MINMEM, |
48 | 48 |
qa_config.get(constants.BE_MINMEM), |
... | ... | |
52 | 52 |
params.extend(["--disk", "%s:size=%s" % (idx, size)]) |
53 | 53 |
|
54 | 54 |
# Set static MAC address if configured |
55 |
nic0_mac = qa_config.GetInstanceNicMac(inst) |
|
55 |
if force_mac: |
|
56 |
nic0_mac = force_mac |
|
57 |
else: |
|
58 |
nic0_mac = qa_config.GetInstanceNicMac(inst) |
|
56 | 59 |
if nic0_mac: |
57 | 60 |
params.extend(["--net", "0:mac=%s" % nic0_mac]) |
58 | 61 |
|
... | ... | |
421 | 424 |
"--src-node=%s" % expnode["primary"], |
422 | 425 |
"--src-dir=%s/%s" % (constants.EXPORT_DIR, name), |
423 | 426 |
"--node=%s" % node["primary"]] + |
424 |
_GetGenericAddParameters(newinst)) |
|
427 |
_GetGenericAddParameters(newinst, force_mac=constants.VALUE_GENERATE))
|
|
425 | 428 |
cmd.append(newinst["name"]) |
426 | 429 |
AssertCommand(cmd) |
427 | 430 |
|
Also available in: Unified diff