]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
Add security_groups for create_port()
authorHui HX Xiang <xianghui@cn.ibm.com>
Fri, 6 Sep 2013 12:48:52 +0000 (05:48 -0700)
committerHui HX Xiang <xianghui@cn.ibm.com>
Wed, 11 Sep 2013 08:18:52 +0000 (01:18 -0700)
commit364031588b7e1faee09191f469089ef62610f6b2
tree3e7776dde2f61d94bf5142630c4a312e8293b5f5
parent340dc1bdd2a14ca866e9d45f09a616359bc7521f
Add security_groups for create_port()

Currently if defined SecurityGroups and SubnetId properties for
instance in heat template, the SecurityGroups were not associated
to the port created within the previous SubnetId, in another word,
the instance are not allocated to the specified security groups
defined in heat template.

    * Modifies function _build_nics() in instance.py, adding an item
'security_groups' in the post body of create_port sending by neutronclient.
    * Adds a new function _get_security_groups_id() to map security_groups
names to ids.
    * Adds corresponding unit tests.

Fixes bug #1221564

Change-Id: Ica2df7c6f96bc982a5bd5ece3611949ae905e5c8
heat/engine/resources/instance.py
heat/tests/test_instance.py