]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
Allow instance NetworkInterfaces to be list of str or dict
authorSteve Baker <sbaker@redhat.com>
Wed, 6 Mar 2013 02:29:12 +0000 (15:29 +1300)
committerSteve Baker <sbaker@redhat.com>
Wed, 6 Mar 2013 02:29:12 +0000 (15:29 +1300)
commitcfcaa895a6357a4bc08ce84928541f2d80c5b0e7
treedc4348139d68f3b4eaaf8e6ef854c2eb3cdff44d
parent8634e15ca10ed9a919bbec1823a56e7eb4dc3d29
Allow instance NetworkInterfaces to be list of str or dict

It should be possible to specify NetworkInterfaces of an instance either
as an array of strings or as an array of dicts.

The following should now be possible:
This will define nics in the order specified by DeviceIndex
"NetworkInterfaces" : [
  { "NetworkInterfaceId" : {"Ref" : "controlXface"}, "DeviceIndex" : "0" },
  { "NetworkInterfaceId" : {"Ref" : "controlXface2"}, "DeviceIndex" : "1" },
],

This will define nics in the order specified by list position
"NetworkInterfaces" : [{"Ref" : "controlXface"}, {"Ref" : "controlXface2"}],

Mixing the 2 forms is supported but the resulting order is not defined.

Amazon documentation is ambigious about which form is actually supported
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#cfn-ec2-instance-networkinterfaces
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2.html#cfn-template-snippets-eni
Fixes: Bug #1096013
Change-Id: Id387d2e750cbe533a9b8a1fedc49d5bcf690fbcf
heat/engine/resources/instance.py
heat/tests/test_instance.py