Merge "Support Security Group Name Prefix Customization"

This commit is contained in:
Jenkins 2013-09-04 04:31:18 +00:00 committed by Gerrit Code Review
commit 6ecab67a17
2 changed files with 3 additions and 1 deletions

View File

@ -122,6 +122,7 @@ common_opts = [
help="Require user hostnames to be IPv4 addresses."),
cfg.BoolOpt('trove_security_groups_support', default=True),
cfg.BoolOpt('trove_security_groups_rules_support', default=True),
cfg.StrOpt('trove_security_group_name_prefix', default='SecGroup'),
cfg.StrOpt('trove_security_group_rule_protocol', default='tcp'),
cfg.IntOpt('trove_security_group_rule_port', default=3306),
cfg.StrOpt('trove_security_group_rule_cidr', default='0.0.0.0/0'),

View File

@ -76,7 +76,8 @@ class SecurityGroup(DatabaseModelBase):
@classmethod
def create_for_instance(cls, instance_id, context):
# Create a new security group
name = _("SecGroup_%s") % instance_id
name = _("%s_%s") %\
(CONF.trove_security_group_name_prefix, instance_id)
description = _("Security Group for %s") % instance_id
sec_group = cls.create_sec_group(name, description, context)