ConfigTreeNode.py
changeset 841 8e19df12b596
parent 833 3f997fb22928
child 842 3c4c1e076a34
equal deleted inserted replaced
840:980863738cf6 841:8e19df12b596
   351                 AllNames.append(CTNInstance.BaseParams.getName())
   351                 AllNames.append(CTNInstance.BaseParams.getName())
   352 
   352 
   353         # Find a free name, eventually appending digit
   353         # Find a free name, eventually appending digit
   354         res = DesiredName
   354         res = DesiredName
   355         if DesiredName.endswith("_0"):
   355         if DesiredName.endswith("_0"):
   356             DesiredName = DesiredName[:-2]
   356             BaseDesiredName = DesiredName[:-2]
       
   357         else:
       
   358             BaseDesiredName = DesiredName
   357         suffix = 1
   359         suffix = 1
   358         while res in AllNames:
   360         while res in AllNames:
   359             res = "%s_%d"%(DesiredName, suffix)
   361             res = "%s_%d"%(BaseDesiredName, suffix)
   360             suffix += 1
   362             suffix += 1
   361         
   363         
   362         # Get old path
   364         # Get old path
   363         oldname = self.CTNPath()
   365         oldname = self.CTNPath()
   364         # Check previous confnode existance
   366         # Check previous confnode existance