V2T migration: Create security group rules in bulk
Change-Id: Id4b3d1fbc2d4a5c1c1b8c9b3727c43e59905bdbb
This commit is contained in:
parent
64a729ec17
commit
8feea3c769
|
@ -359,14 +359,17 @@ class ApiReplayClient(utils.PrepareObjectForMigration):
|
||||||
{'sg': sg, 'e': e})
|
{'sg': sg, 'e': e})
|
||||||
n_errors = n_errors + 1
|
n_errors = n_errors + 1
|
||||||
|
|
||||||
# Note - policy security groups will have no rules, and will
|
# Use bulk rules creation for the rules of the SG
|
||||||
# be created on the destination with the default rules only
|
if sg_rules:
|
||||||
for sg_rule in sg_rules:
|
rules = []
|
||||||
try:
|
for sg_rule in sg_rules:
|
||||||
body = self.prepare_security_group_rule(sg_rule)
|
body = self.prepare_security_group_rule(sg_rule)
|
||||||
rule = self.dest_neutron.create_security_group_rule(
|
rules.append({'security_group_rule': body})
|
||||||
{'security_group_rule': body})
|
try:
|
||||||
LOG.debug("created security group rule %s", rule['id'])
|
rules = self.dest_neutron.create_security_group_rule(
|
||||||
|
{'security_group_rules': rules})
|
||||||
|
LOG.debug("created %s security group rules for SG %s",
|
||||||
|
len(rules), sg['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
# NOTE(arosen): when you create a default
|
# NOTE(arosen): when you create a default
|
||||||
# security group it is automatically populated
|
# security group it is automatically populated
|
||||||
|
|
Loading…
Reference in New Issue