(self, force=False, to_container=True, orig_path="")
return links
Convert absolute symbolic links to relative symbolic links
Convert absolute symbolic links to relative symbolic links
Convert absolute symbolic links to relative symbolic links
def links_conv(self, force=False, to_container=True, orig_path=""):
        """ Convert absolute symbolic links to relative symbolic links"""
        root_path = os.path.realpath(self.filename)
        links = []
        if not self._is_safe_prefix(root_path):
            Msg().err("Error: links convertion outside of directory tree: ",
                      root_path)
            return None
        for dir_path, dirs, files in os.walk(root_path):
            for f_name in files + dirs:
                try:
                    f_path = dir_path + "/" + f_name
                    if not os.path.islink(f_path):
                        continue
                    if os.lstat(f_path).st_uid != HostInfo.uid:
                        continue
                    if to_container:
                        if self._link_set(f_path, orig_path, root_path, force):
                            links.append(f_path)
                    else:
                        if self._link_restore(f_path, orig_path,
                                              root_path, force):
                            links.append(f_path)
                except OSError:
                    continue
        return links
def links_conv ( self , force = False , to_container = True , orig_path = "" ) : root_path = os . path . realpath ( self . filename ) links = [ ] if not self . _is_safe_prefix ( root_path ) : Msg ( ) . err ( "Error: links convertion outside of directory tree: " , root_path ) return None for dir_path , dirs , files in os . walk ( root_path ) : for f_name in files + dirs : try : f_path = dir_path + "/" + f_name if not os . path . islink ( f_path ) : continue if os . lstat ( f_path ) . st_uid != HostInfo . uid : continue if to_container : if self . _link_set ( f_path , orig_path , root_path , force ) : links . append ( f_path ) else : if self . _link_restore ( f_path , orig_path , root_path , force ) : links . append ( f_path ) except OSError : continue return links