Merge "Rename source_(group_id/ip_prefix) to remote_(group_id/ip_prefix)"
This commit is contained in:
@@ -90,8 +90,8 @@ class SecurityGroupAPI(security_group_base.SecurityGroupBase):
|
||||
nova_rule['to_port'] = -1
|
||||
else:
|
||||
nova_rule['to_port'] = rule['port_range_max']
|
||||
nova_rule['group_id'] = rule['source_group_id']
|
||||
nova_rule['cidr'] = rule['source_ip_prefix']
|
||||
nova_rule['group_id'] = rule['remote_group_id']
|
||||
nova_rule['cidr'] = rule['remote_ip_prefix']
|
||||
return nova_rule
|
||||
|
||||
def get(self, context, name=None, id=None, map_exception=False):
|
||||
@@ -205,9 +205,9 @@ class SecurityGroupAPI(security_group_base.SecurityGroupBase):
|
||||
new_rule['ethertype'] = 'IPv4'
|
||||
else:
|
||||
new_rule['ethertype'] = utils.get_ip_version(rule.get('cidr'))
|
||||
new_rule['source_ip_prefix'] = rule.get('cidr')
|
||||
new_rule['remote_ip_prefix'] = rule.get('cidr')
|
||||
new_rule['security_group_id'] = rule.get('parent_group_id')
|
||||
new_rule['source_group_id'] = rule.get('group_id')
|
||||
new_rule['remote_group_id'] = rule.get('group_id')
|
||||
if rule['from_port'] != -1:
|
||||
new_rule['port_range_min'] = rule['from_port']
|
||||
if rule['to_port'] != -1:
|
||||
|
||||
@@ -532,8 +532,8 @@ class MockClient(object):
|
||||
# does not handle bulk case so just picks rule[0]
|
||||
r = body.get('security_group_rules')[0]
|
||||
fields = ['direction', 'protocol', 'port_range_min', 'port_range_max',
|
||||
'ethertype', 'source_ip_prefix', 'tenant_id',
|
||||
'security_group_id', 'source_group_id']
|
||||
'ethertype', 'remote_ip_prefix', 'tenant_id',
|
||||
'security_group_id', 'remote_group_id']
|
||||
ret = {}
|
||||
for field in fields:
|
||||
ret[field] = r.get(field)
|
||||
|
||||
Reference in New Issue
Block a user