ruleAware.flushPendingSecurityRulesFor(createdSecGroup.getKey(), neutron);
}
- public boolean addNeutronSecurityGroup(SecurityGroup secGroup, ReadWriteTransaction rwTx) {
+ boolean addNeutronSecurityGroup(SecurityGroup secGroup, ReadWriteTransaction rwTx) {
if (secGroup.getTenantId() == null) {
LOG.warn("Skip processing group {} because TenantId is null.", secGroup);
// TODO This needs to be reworked, SecGroups shouldn't use TenantId, Neutron doesn't always configure it
@Override
public void onDeleted(SecurityGroup deletedSecGroup, Neutron oldNeutron, Neutron newNeutron) {
+ if (deletedSecGroup.getTenantId() == null) {
+ LOG.warn("Skip deleting SecGroup {} because TenantId is null.", deletedSecGroup);
+ // TODO This needs to be reworked, SecGroups shouldn't use TenantId, Neutron doesn't always configure it
+ return;
+ }
LOG.trace("deleted securityGroup - {}", deletedSecGroup);
if (newNeutron != null && newNeutron.getSecurityRules() != null
&& newNeutron.getSecurityRules().getSecurityRule() != null
&& newNeutron.getSecurityRules()
.getSecurityRule()
.stream()
- .filter(sr -> sr.getSecurityGroupId().equals(deletedSecGroup.getUuid()))
- .findAny()
- .isPresent()) {
+ .anyMatch(sr -> sr.getSecurityGroupId().equals(deletedSecGroup.getUuid()))) {
LOG.warn("Cannot remove security group {} before removing last security rule.", deletedSecGroup.getKey());
ruleAware.addPendingDeletedSecGroup(deletedSecGroup);
return;
@Override
public void onDeleted(SecurityRule deletedSecRule, Neutron oldNeutron, Neutron newNeutron) {
+ if (deletedSecRule.getTenantId() == null) {
+ LOG.warn("Skip deleting SecRule {} because TenantId is null.", deletedSecRule);
+ // TODO This needs to be reworked, SecGroups shouldn't use TenantId, Neutron doesn't always configure it
+ return;
+ }
LOG.trace("deleted securityRule - {}", deletedSecRule);
ReadWriteTransaction rwTx = dataProvider.newReadWriteTransaction();
boolean isNeutronSecurityRuleDeleted = deleteNeutronSecurityRule(deletedSecRule, oldNeutron, rwTx);
bridgeDomainBuilder.setId(network.getUuid().getValue());
NetworkProviderExtension providerAug = network.getAugmentation(NetworkProviderExtension.class);
if (providerAug == null || providerAug.getNetworkType() == null) {
- LOG.error("Cannot create VPP bridge domain. Network type not specified in neutron network: {}", network);
+ LOG.warn("Cannot create VPP bridge domain. Network type not specified in neutron network: {}", network);
return null;
}
Class<? extends NetworkTypeBase> netType = convertNetworkType(providerAug.getNetworkType());