This ensures that the network XML, VM XML, and Ironic node definitions
remain in sync when the vm-setup playbooks is run multiple times.
Issue-ID: ICN-453
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I2f48a91b6a031bffb9a204fa8d93de326bc94b54
# generate_baremetal_macs method ripped from
# openstack/tripleo-incubator/scripts/configure-vm
# generate_baremetal_macs method ripped from
# openstack/tripleo-incubator/scripts/configure-vm
import math
import random
import math
import random
raise ValueError("The MAX num of MACS supported is %i "
"(you specified %i)." % (MAX_NUM_MACS, count))
raise ValueError("The MAX num of MACS supported is %i "
"(you specified %i)." % (MAX_NUM_MACS, count))
+ # See the random number generator with the input so that MAC
+ # generation is idempotent.
+ random.seed(marshal.dumps(nodes + networks))
+
base_nums = [0x00,
random.randint(0x00, 0xff),
random.randint(0x00, 0xff),
base_nums = [0x00,
random.randint(0x00, 0xff),
random.randint(0x00, 0xff),