ConfigTreeNode.py
changeset 833 3f997fb22928
parent 814 5743cbdff669
child 841 8e19df12b596
equal deleted inserted replaced
832:b2609a8e4cb6 833:3f997fb22928
   350             if CTNInstance != self:
   350             if CTNInstance != self:
   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"):
       
   356             DesiredName = DesiredName[:-2]
   355         suffix = 1
   357         suffix = 1
   356         while res in AllNames:
   358         while res in AllNames:
   357             res = "%s-%d"%(DesiredName, suffix)
   359             res = "%s_%d"%(DesiredName, suffix)
   358             suffix += 1
   360             suffix += 1
   359         
   361         
   360         # Get old path
   362         # Get old path
   361         oldname = self.CTNPath()
   363         oldname = self.CTNPath()
   362         # Check previous confnode existance
   364         # Check previous confnode existance