diff --git a/cairis/core/TrustBoundary.py b/cairis/core/TrustBoundary.py index 18bb50875..43807ff3a 100644 --- a/cairis/core/TrustBoundary.py +++ b/cairis/core/TrustBoundary.py @@ -28,6 +28,7 @@ def __init__(self,tbId = -1,tbName = '',tbType = 'General', tbDesc = '',comps = self.theTags = tags def id(self): return self.theId + def setId(self,anId): self.theId = anId def name(self): return self.theName def type(self): return self.theType def description(self): return self.theDescription diff --git a/cairis/mio/ModelImport.py b/cairis/mio/ModelImport.py index 0a1459576..f9ad9f403 100644 --- a/cairis/mio/ModelImport.py +++ b/cairis/mio/ModelImport.py @@ -779,7 +779,12 @@ def importTrustBoundaries(tbs,session_id): b = Borg() db_proxy = b.get_dbproxy(session_id) for tb in tbs: - db_proxy.addTrustBoundary(tb) + objtId = db_proxy.existingObject(tb.name(),'trust_boundary') + if objtId == -1: + db_proxy.addTrustBoundary(tb) + else: + tb.setId(objtId) + db_proxy.updateTrustBoundary(tb) noOfTrustBoundaries = len(tbs) msgStr = 'Imported ' +str( noOfTrustBoundaries) + ' trust boundar' if (noOfTrustBoundaries != 1):