Skip to content

Commit 65551cf

Browse files
author
Alena Prokharchyk
committed
Resource tags: CS-15647 - delete resource tags when SG is expunged
1 parent 4c6e547 commit 65551cf

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎server/src/com/cloud/network/security/dao/SecurityGroupDaoImpl.java‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,19 @@ public boolean remove(Long id) {
113113
boolean result = super.remove(id);
114114
txn.commit();
115115
return result;
116+
}
117+
118+
@Override
119+
@DB
120+
public boolean expunge(Long id) {
121+
Transaction txn = Transaction.currentTxn();
122+
txn.start();
123+
SecurityGroupVO entry = findById(id);
124+
if (entry != null) {
125+
_tagsDao.removeByIdAndType(id, TaggedResourceType.SecurityGroup);
126+
}
127+
boolean result = super.expunge(id);
128+
txn.commit();
129+
return result;
116130
}
117131
}

0 commit comments

Comments
 (0)