(self, f_path, orig_path, root_path, force)
return False
Convertion for host specific symbolic link
Convertion for host specific symbolic link
Convertion for host specific symbolic link
def _link_restore(self, f_path, orig_path, root_path, force):
        """Convertion for host specific symbolic link"""
        l_path = os.readlink(f_path)
        new_l_path = ""
        if not l_path.startswith("/"):
            return False
        regexp_id = "[a-z0-9]+-[a-z0-9]+-[a-z0-9]+-[a-z0-9]+-[a-z0-9]+"
        recomp = re.compile("(/.*/containers/" + regexp_id + "/ROOT)(/.*)")
        if orig_path and l_path.startswith(orig_path):
            new_l_path = l_path.replace(orig_path, "", 1)
        elif l_path.startswith(root_path):
            new_l_path = l_path.replace(root_path, "", 1)
        elif orig_path == "":
            match = recomp.match(l_path)
            if match:
                new_l_path = l_path.replace(match.group(1), "", 1)
        if new_l_path:
            self._link_change_apply(new_l_path, f_path, force)
            return True
        return False
def _link_restore ( self , f_path , orig_path , root_path , force ) : l_path = os . readlink ( f_path ) new_l_path = "" if not l_path . startswith ( "/" ) : return False regexp_id = "[a-z0-9]+-[a-z0-9]+-[a-z0-9]+-[a-z0-9]+-[a-z0-9]+" recomp = re . compile ( "(/.*/containers/" + regexp_id + "/ROOT)(/.*)" ) if orig_path and l_path . startswith ( orig_path ) : new_l_path = l_path . replace ( orig_path , "" , 1 ) elif l_path . startswith ( root_path ) : new_l_path = l_path . replace ( root_path , "" , 1 ) elif orig_path == "" : match = recomp . match ( l_path ) if match : new_l_path = l_path . replace ( match . group ( 1 ) , "" , 1 ) if new_l_path : self . _link_change_apply ( new_l_path , f_path , force ) return True return False