Commits

prologic  committed 8c9a41e

Added logic to fix broken VE_PRIVATE path

  • Participants
  • Parent commits 664e869

Comments (0)

Files changed (1)

 from os import path, rename
 from optparse import OptionParser
 
-__version__ = "0.0.2"
+__version__ = "0.0.3"
 
 USAGE = "%prog [options] <old_ctid> <new_ctid>"
 VERSION = "%prog v" + __version__
 
     s = open(new_config, "r").read()
 
+    # Fix broken VE_PRIVATE path
+    m = re.search("^VE_PRIVATE=\"(.*)\"$(?m)", s)
+    path = m.group(0)
+    s = s.replace(path, path.replace(str(old_ctid), str(new_ctid)))
+
     # Fix names of virtual ethernet interfaces
     s = sub("(host_ifname=veth)(%s)" % old_ctid, "\g<1>%s" % new_ctid, s)