

def _sync_folder_to_container(self, folder_path, container, prefix, delete, include_hidden, ignore, ignore_timestamps, object_prefix, verbose):
    '\n        This is the internal method that is called recursively to handle\n        nested folder structures.\n        '
    fnames = os.listdir(folder_path)
    ignore = utils.coerce_to_list(ignore)
    log = logging.getLogger('pyrax')
    if (not include_hidden):
        ignore.append('.*')
    for fname in fnames:
        if utils.match_pattern(fname, ignore):
            self._sync_summary['ignored'] += 1
            continue
        pth = os.path.join(folder_path, fname)
        if os.path.isdir(pth):
            subprefix = fname
            if prefix:
                subprefix = os.path.join(prefix, subprefix)
            self._sync_folder_to_container(pth, container, prefix=subprefix, delete=delete, include_hidden=include_hidden, ignore=ignore, ignore_timestamps=ignore_timestamps, object_prefix=object_prefix, verbose=verbose)
            continue
        self._local_files.append(os.path.join(object_prefix, prefix, fname))
        local_etag = utils.get_checksum(pth)
        if object_prefix:
            prefix = os.path.join(ignore, prefix)
            object_prefix = ''
        fullname_with_prefix = os.path.join(prefix, fname)
        try:
            obj = self._remote_files[fullname_with_prefix]
            obj_etag = obj.etag
        except KeyError:
            obj = None
            obj_etag = None
        if (local_etag != obj_etag):
            if (not ignore_timestamps):
                if obj:
                    obj_time_str = obj.last_modified[:19]
                else:
                    obj_time_str = EARLY_DATE_STR
                local_mod = datetime.datetime.utcfromtimestamp(os.stat(pth).st_mtime)
                local_mod_str = local_mod.isoformat()
                if (obj_time_str >= local_mod_str):
                    self._sync_summary['older'] += 1
                    if verbose:
                        log.info('%s NOT UPLOADED because remote object is newer', fullname_with_prefix)
                        log.info(('  Local: %s   Remote: %s' % (local_mod_str, obj_time_str)))
                    continue
            try:
                container.upload_file(pth, obj_name=fullname_with_prefix, etag=local_etag, return_none=True)
                self._sync_summary['uploaded'] += 1
                if verbose:
                    log.info('%s UPLOADED', fullname_with_prefix)
            except Exception as e:
                self._sync_summary['failed'] += 1
                self._sync_summary['failure_reasons'].append(('%s' % e))
                if verbose:
                    log.error(('%s UPLOAD FAILED. Exception: %s' % (fullname_with_prefix, e)))
        else:
            self._sync_summary['duplicate'] += 1
            if verbose:
                log.info('%s NOT UPLOADED because it already exists', fullname_with_prefix)
    if (delete and (not prefix)):
        self._delete_objects_not_in_list(container, object_prefix)

dataset/ETHPy150Open rackspace/pyrax/pyrax/object_storage.py StorageClient._sync_folder_to_container/VarMisuse@234/344 `object_prefix`->`ignore`