Ejemplo n.º 1
0
    def get_package_store(self) -> pkgstores.PackageStore:
        """Return the appropriate package store as set in the config.

        Returns
        -------
        package_store : pkgstores.PackageStore
            The package store instance to enact package operations against
        """
        if self.config.get('s3'):
            return pkgstores.S3Store({
                'key': self.s3_access_key,
                'secret': self.s3_secret_key,
                'url': self.s3_url,
                'region': self.s3_region,
                'bucket_prefix': self.s3_bucket_prefix,
                'bucket_suffix': self.s3_bucket_suffix,
            })
        elif self.config.get('azure_blob'):
            return pkgstores.AzureBlobStore({
                'account_name':
                self.azure_blob_account_name,
                'account_access_key':
                self.azure_blob_account_access_key,
                'conn_str':
                self.azure_blob_conn_str,
                'container_prefix':
                self.azure_blob_container_prefix,
                'container_suffix':
                self.azure_blob_container_suffix,
            })
        else:
            return pkgstores.LocalStore({'channels_dir': 'channels'})
Ejemplo n.º 2
0
    def get_package_store(self) -> pkgstores.PackageStore:
        """Return the appropriate package store as set in the config.

        Returns
        -------
        package_store : pkgstores.PackageStore
            The package store instance to enact package operations against
        """
        if self.config.get('s3'):
            return pkgstores.S3Store(
                {
                    'key': self.s3_access_key,
                    'secret': self.s3_secret_key,
                    'url': self.s3_url,
                    'region': self.s3_region,
                    'bucket_prefix': self.s3_bucket_prefix,
                    'bucket_suffix': self.s3_bucket_suffix,
                }
            )
        elif self.config.get('azure_blob'):
            return pkgstores.AzureBlobStore(
                {
                    'account_name': self.azure_blob_account_name,
                    'account_access_key': self.azure_blob_account_access_key,
                    'conn_str': self.azure_blob_conn_str,
                    'container_prefix': self.azure_blob_container_prefix,
                    'container_suffix': self.azure_blob_container_suffix,
                }
            )
        elif self.config.get('gcs'):
            return pkgstores.GoogleCloudStorageStore(
                {
                    'project': self.gcs_project,
                    'token': self.gcs_token,
                    'bucket_prefix': self.gcs_bucket_prefix,
                    'bucket_suffix': self.gcs_bucket_suffix,
                }
            )
        else:
            return pkgstores.LocalStore(
                {
                    'channels_dir': 'channels',
                    'redirect_enabled': self.local_store_redirect_enabled,
                    'redirect_endpoint': self.local_store_redirect_endpoint,
                    'redirect_secret': self.local_store_redirect_secret,
                    'redirect_expiration': int(self.local_store_redirect_expiration),
                }
            )
Ejemplo n.º 3
0
    def get_package_store(self) -> pkgstores.PackageStore:
        """Return the appropriate package store as set in the config.

        Returns
        -------
        package_store : pkgstores.PackageStore
            The package store instance to enact package operations against
        """
        if self.config.get('s3'):
            return pkgstores.S3Store({
                'key': self.s3_access_key,
                'secret': self.s3_secret_key,
                'url': self.s3_url,
                'bucket_prefix': self.s3_bucket_prefix,
                'bucket_suffix': self.s3_bucket_suffix,
            })
        else:
            return pkgstores.LocalStore({'channels_dir': 'channels'})