Fixed auto security group for nova network

Replaced OS::Neutron::SecurityGroup with AWS::EC2::SecurityGroup.
AWS::EC2::SecurityGroup supports both neutron and nova network.
We don't use neutron-specific instructions.

Enabled auto security group in integration tests for hdp2 plugin.

Increased version of heat engine.

Change-Id: Id5159c54ad83fd86887f9b718b7545603467bb9a
Closes-Bug: #1392738
Closes-Bug: #1400352
This commit is contained in:
Andrew Lazarev 2014-11-25 12:36:10 -08:00
parent 8bd8a9934a
commit 23a4991620
4 changed files with 11 additions and 13 deletions

View File

@ -1,8 +1,7 @@
"%(security_group_name)s": {
"Type": "OS::Neutron::SecurityGroup",
"%(security_group_name)s": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"description": "%(security_group_description)s",
"name": "%(security_group_name)s",
"rules": %(rules)s
"GroupDescription": "%(security_group_description)s",
"SecurityGroupIngress": %(rules)s
}
}

View File

@ -33,7 +33,7 @@ LOG = logging.getLogger(__name__)
class HeatEngine(e.Engine):
def get_type_and_version(self):
return "heat.1.0"
return "heat.1.1"
def _add_volumes(self, ctx, cluster):
for instance in g.get_instances(cluster):

View File

@ -73,9 +73,7 @@ class HDP2GatingTest(swift.SwiftTest, scaling.ScalingTest,
'description': 'test node group template for HDP plugin',
'node_processes': self.hdp2_config.WORKER_NODE_PROCESSES,
'floating_ip_pool': self.floating_ip_pool,
# TODO(sreshetniak): Enable auto security group when #1392738 is
# resolved
'auto_security_group': False,
'auto_security_group': True,
'node_configs': {}
}
self.ng_tmpl_nm_dn_id = self.create_node_group_template(**template)

View File

@ -17,6 +17,7 @@ import json
from heatclient import client as heat_client
from oslo.config import cfg
import six
from sahara import context
from sahara import exceptions as ex
@ -178,10 +179,10 @@ class ClusterTemplate(object):
def _serialize_auto_security_group_rules(self, ng):
create_rule = lambda cidr, proto, from_port, to_port: {
'remote_ip_prefix': cidr,
'protocol': proto,
'port_range_min': from_port,
'port_range_max': to_port}
"CidrIp": cidr,
"IpProtocol": proto,
"FromPort": six.text_type(from_port),
"ToPort": six.text_type(to_port)}
rules = []
for port in ng.open_ports: