Remove Swift handler (for now)
Pyrax is deprecated and causing installation problems. Nuclear option. Change-Id: I2d27a541e6617e468862fd13c473ea0ce7bc774b
This commit is contained in:
parent
346fd39d24
commit
2be257bbfd
@ -1,3 +0,0 @@
|
||||
[rackspace_cloud]
|
||||
username = my_username
|
||||
api_key = 01234567890abcdef
|
@ -1,5 +1,4 @@
|
||||
notigen
|
||||
notification_utils
|
||||
pyrax
|
||||
python-dateutil
|
||||
simport >= 0.0.dev0
|
||||
|
@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = shoebox
|
||||
version = 0.42
|
||||
version = 0.5
|
||||
author = Dark Secret Software Inc.
|
||||
author-email = admin@darksecretsoftware.com
|
||||
summary = data archiving library
|
||||
|
@ -17,8 +17,6 @@ import os
|
||||
import os.path
|
||||
import shutil
|
||||
|
||||
import pyrax
|
||||
|
||||
import simport
|
||||
|
||||
|
||||
@ -92,30 +90,3 @@ class DeleteFileCallback(ArchiveCallback):
|
||||
"""Delete this file."""
|
||||
os.remove(filename)
|
||||
return None
|
||||
|
||||
|
||||
class SwiftUploadCallback(ArchiveCallback):
|
||||
def __init__(self, **kwargs):
|
||||
super(SwiftUploadCallback, self).__init__(**kwargs)
|
||||
self.credentials_file = kwargs.get('credentials_file')
|
||||
if not self.credentials_file:
|
||||
raise MissingArgument("No credentials_file defined.")
|
||||
|
||||
self.container = kwargs.get('container', 'shoebox')
|
||||
self.auth_method = kwargs.get('auth_method', 'rackspace')
|
||||
self.region = kwargs.get('region', 'DFW')
|
||||
|
||||
pyrax.set_setting('identity_type', self.auth_method)
|
||||
pyrax.set_setting("region", self.region)
|
||||
pyrax.set_credential_file(self.credentials_file)
|
||||
|
||||
self.cloud_files = pyrax.cloudfiles
|
||||
|
||||
self.cloud_files.create_container(self.container)
|
||||
|
||||
def on_close(self, filename):
|
||||
checksum = pyrax.utils.get_checksum(filename)
|
||||
# Blocking call ...
|
||||
obj = self.cloud_files.upload_file(self.container, filename,
|
||||
etag=checksum)
|
||||
return filename
|
||||
|
Loading…
x
Reference in New Issue
Block a user