(self)
return (':'.join(host_volumes_list), ':'.join(map_volumes_list))
Get the volume bindings string for fakechroot run
Get the volume bindings string for fakechroot run
Get the volume bindings string for fakechroot run
def _get_volume_bindings(self):
        """Get the volume bindings string for fakechroot run"""
        host_volumes_list = []
        map_volumes_list = []
        map_volumes_dict = dict()
        for vol in self.opt["vol"]:
            (host_path, cont_path) = Uvolume(vol).split()
            if not (host_path and cont_path):
                continue
            real_host_path = os.path.realpath(host_path)
            if (host_path == cont_path and
                    Config.conf['fakechroot_expand_symlinks'] is False):
                host_volumes_list.append(host_path)
            elif (host_path == cont_path and
                  host_path in Config.conf['sysdirs_list']):
                host_volumes_list.append(host_path)
            elif host_path == cont_path and not os.path.isdir(real_host_path):
                host_volumes_list.append(host_path)
            else:
                map_volumes_dict[cont_path] = real_host_path + '!' + cont_path
                if host_path != real_host_path or os.path.isdir(real_host_path):
                    self._recommend_expand_symlinks = True
        for cont_path in sorted(map_volumes_dict, reverse=True):
            map_volumes_list.append(map_volumes_dict[cont_path])
        return (':'.join(host_volumes_list), ':'.join(map_volumes_list))
def _get_volume_bindings ( self ) : host_volumes_list = [ ] map_volumes_list = [ ] map_volumes_dict = dict ( ) for vol in self . opt [ "vol" ] : ( host_path , cont_path ) = Uvolume ( vol ) . split ( ) if not ( host_path and cont_path ) : continue real_host_path = os . path . realpath ( host_path ) if ( host_path == cont_path and Config . conf [ 'fakechroot_expand_symlinks' ] is False ) : host_volumes_list . append ( host_path ) elif ( host_path == cont_path and host_path in Config . conf [ 'sysdirs_list' ] ) : host_volumes_list . append ( host_path ) elif host_path == cont_path and not os . path . isdir ( real_host_path ) : host_volumes_list . append ( host_path ) else : map_volumes_dict [ cont_path ] = real_host_path + '!' + cont_path if host_path != real_host_path or os . path . isdir ( real_host_path ) : self . _recommend_expand_symlinks = True for cont_path in sorted ( map_volumes_dict , reverse = True ) : map_volumes_list . append ( map_volumes_dict [ cont_path ] ) return ( ':' . join ( host_volumes_list ) , ':' . join ( map_volumes_list ) )