#347 Reuse koji API unique_path to generate path for uploading SRPM
Closed: Fixed 4 years ago by onosek. Opened 5 years ago by cqi.

There is a fix[1] in koji to make API unique_path publicly. rpkg could call this function to generate server directory path for uploading SRPM instead of doing it by itself.

[1] https://pagure.io/koji/issue/975


Here is how I handled this in another project:

try:
    # Available in Koji v1.17, https://pagure.io/koji/issue/975
    from koji_cli.lib import unique_path
except ImportError:
    from koji_cli.lib import _unique_path as unique_path

And then here is how I used it later:

def upload(all_files, session):
    """
    Upload all files to a remote directory in Koji.
    """
    remote_directory = unique_path('cli-import')
    log.info('uploading files to %s' % remote_directory)

    for filename in all_files:
        callback = _progress_callback
        log.info("Uploading %s" % filename)
        session.uploadWrapper(filename, remote_directory, callback=callback)
        if callback:
            print('')
    return remote_directory

It looks the issue is connected with https://pagure.io/rpkg/pull-request/336. I was waiting for internal koji release, so PR could be finally closed. Thanks for the notification.

Metadata Update from @onosek:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

4 years ago

Metadata Update from @onosek:
- Issue set to the milestone: 1.60 (was: NEXT)

a year ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #336 Merged 4 years ago