Revert "Merge pull request #2844 from coreos-inc/alegrand/use_latest_appr_server_code"
This reverts commit646fafb2fd
, reversing changes made to5c1b635439
.
This commit is contained in:
parent
49df658e20
commit
9e09612851
16 changed files with 68 additions and 106 deletions
|
@ -1,8 +1,8 @@
|
|||
from datetime import datetime
|
||||
|
||||
import appr.semver
|
||||
import cnr.semver
|
||||
|
||||
from appr.exception import raise_package_not_found, raise_channel_not_found
|
||||
from cnr.exception import raise_package_not_found, raise_channel_not_found
|
||||
|
||||
import data.model
|
||||
|
||||
|
@ -76,7 +76,7 @@ class OCIAppModel(AppRegistryDataInterface):
|
|||
if not releases:
|
||||
continue
|
||||
available_releases = [
|
||||
str(x) for x in sorted(appr.semver.versions(releases, False), reverse=True)]
|
||||
str(x) for x in sorted(cnr.semver.versions(releases, False), reverse=True)]
|
||||
channels = None
|
||||
if with_channels:
|
||||
channels = [
|
||||
|
@ -173,19 +173,19 @@ class OCIAppModel(AppRegistryDataInterface):
|
|||
MediaType.DoesNotExist):
|
||||
raise_package_not_found(package_name, release, media_type)
|
||||
|
||||
def store_blob(self, apprblob, content_media_type):
|
||||
fp = apprblob.packager.io_file
|
||||
path = apprblob.upload_url(apprblob.digest)
|
||||
def store_blob(self, cnrblob, content_media_type):
|
||||
fp = cnrblob.packager.io_file
|
||||
path = cnrblob.upload_url(cnrblob.digest)
|
||||
locations = storage.preferred_locations
|
||||
storage.stream_write(locations, path, fp, 'application/x-gzip')
|
||||
db_blob = oci_model.blob.get_or_create_blob(apprblob.digest, apprblob.size, content_media_type,
|
||||
db_blob = oci_model.blob.get_or_create_blob(cnrblob.digest, cnrblob.size, content_media_type,
|
||||
locations)
|
||||
return BlobDescriptor(mediaType=content_media_type,
|
||||
digest=_strip_sha256_header(db_blob.digest), size=db_blob.size, urls=[])
|
||||
|
||||
def create_release(self, package, user, visibility, force=False):
|
||||
""" Add an app-release to a repository
|
||||
package is an instance of data.appr.package.Package
|
||||
package is an instance of data.cnr.package.Package
|
||||
"""
|
||||
|
||||
manifest = package.manifest()
|
||||
|
|
Reference in a new issue