Skip to content

Commit

Permalink
Rename source_(group_id/ip_prefix) to remote_(group_id/ip_prefix)
Browse files Browse the repository at this point in the history
Fixes bug 1144426

Change-Id: I28735aea05738487861e477aaa3b0a3cec081821
  • Loading branch information
aaronorosen committed Mar 4, 2013
1 parent 4cb4749 commit cb03ee5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions nova/network/security_group/quantum_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def _convert_to_nova_security_group_rule_format(self, rule):
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):
Expand Down Expand Up @@ -205,9 +205,9 @@ def _make_quantum_security_group_rules_list(self, rules):
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ def create_security_group_rule(self, body):
# 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)
Expand Down

0 comments on commit cb03ee5

Please sign in to comment.