mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-07 05:42:42 +00:00
Add support for Azure package pools
This adds support for storing packages directly on Azure, with no truly "local" (on-disk) repo used. The existing Azure PublishedStorage implementation was refactored to move the shared code to a separate context struct, which can then be re-used by the new PackagePool. In addition, the files package's mockChecksumStorage was made public so that it could be used in the Azure PackagePool tests as well. Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
This commit is contained in:
committed by
André Roth
parent
810df17009
commit
f9325fbc91
+8
-3
@@ -60,7 +60,8 @@ class AzureTest(BaseTest):
|
||||
}
|
||||
if self.use_azure_pool:
|
||||
self.configOverride['packagePoolStorage'] = {
|
||||
'azure': self.azure_endpoint,
|
||||
'type': 'azure',
|
||||
**self.azure_endpoint,
|
||||
}
|
||||
|
||||
super(AzureTest, self).prepare()
|
||||
@@ -78,7 +79,7 @@ class AzureTest(BaseTest):
|
||||
]
|
||||
|
||||
if path.startswith('public/'):
|
||||
path = path[7:]
|
||||
path = path.removeprefix('public/')
|
||||
|
||||
if path in self.container_contents:
|
||||
return True
|
||||
@@ -96,6 +97,10 @@ class AzureTest(BaseTest):
|
||||
if not self.check_path(path):
|
||||
raise Exception("path %s doesn't exist" % (path,))
|
||||
|
||||
def check_exists_azure_only(self, path):
|
||||
self.check_exists(path)
|
||||
BaseTest.check_not_exists(self, path)
|
||||
|
||||
def check_not_exists(self, path):
|
||||
if self.check_path(path):
|
||||
raise Exception('path %s exists' % (path,))
|
||||
@@ -104,7 +109,7 @@ class AzureTest(BaseTest):
|
||||
assert not mode
|
||||
|
||||
if path.startswith('public/'):
|
||||
path = path[7:]
|
||||
path = path.removeprefix('public/')
|
||||
|
||||
blob = self.container.download_blob(path)
|
||||
return blob.readall().decode('utf-8')
|
||||
|
||||
Reference in New Issue
Block a user