comparison farolluz/document.py @ 31:1ea1a3c3c790

Add method to change a Group ID
author Benoît Allard <benoit.allard@greenbone.net>
date Mon, 27 Oct 2014 12:29:56 +0100
parents b15022ae484a
children b87f2a6e613a
comparison
equal deleted inserted replaced
30:b15022ae484a 31:1ea1a3c3c790
304 item._relatestoproductreference = new 304 item._relatestoproductreference = new
305 else: 305 else:
306 item._productids.remove(old) 306 item._productids.remove(old)
307 item._productids.append(new) 307 item._productids.append(new)
308 308
309 def mentionsGroupId(self, groupid):
310 for vulnerability in self._vulnerabilities:
311 for item in vulnerability.mentionsGroupId(groupid):
312 yield item
313
309 def isGroupOrphan(self, groupid): 314 def isGroupOrphan(self, groupid):
310 """ Returns if a group can be safely deleted """ 315 """ Returns if a group can be safely deleted """
311 for vulnerability in self._vulnerabilities: 316 for _ in self.mentionsGroupId(groupid):
312 if vulnerability.isMentioningGroupId(groupid): 317 return False
313 return False
314 return True 318 return True
319
320 def changeGroupID(self, old, new):
321 for item in self.mentionsGroupId(old):
322 item._groupids.remove(old)
323 item._groupids.append(new)
315 324
316 def isProductTreeOrphan(self): 325 def isProductTreeOrphan(self):
317 """ Difference with the previous method is that we don;t care about 326 """ Difference with the previous method is that we don;t care about
318 inter-producttree references """ 327 inter-producttree references """
319 for vulnerability in self._vulnerabilities: 328 for vulnerability in self._vulnerabilities:
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)