Comment 1 for bug 1580621

Revision history for this message
Matt Riedemann (mriedem) wrote :

Another thing, we get the source group again here when formatting the security group rules:

https://github.com/openstack/nova/blob/f8a01ccdffc13403df77148867ef3821100b5edb/nova/api/openstack/compute/security_groups.py#L71

But if we had the group_id already, then we have group_rule_data in that code and it has what we need, so that should change to either:

if group_rule_data:
  sg_rule['group'] = group_rule_data
elif rule['group_id']:
  ...
else
  sg_rule['ip_range'] = {'cidr': rule['cidr']}

Or:

if rule['group_id'] and not group_rule_data:
  ...
elif group_rule_data:
  ...
else:
  ...