Esempio n. 1
0
def init_handlers_from_config():
    """
  Use the config to create handlers for Amazon Glacier
  """
    for region in glacier.regions():
        WG.handlers[region.name] = Layer1(
            aws_access_key_id=WG.app.config["AWS_ACCESS_KEY"],
            aws_secret_access_key=WG.app.config["AWS_SECRET_ACCESS_KEY"],
            region_name=region.name)
Esempio n. 2
0
def init_handlers_from_config():
    """
  Use the config to create handlers for Amazon Glacier
  """
    for region in glacier.regions():
        WG.handlers[region.name] = Layer1(
            aws_access_key_id=WG.app.config["AWS_ACCESS_KEY"],
            aws_secret_access_key=WG.app.config["AWS_SECRET_ACCESS_KEY"],
            region_name=region.name,
        )
Esempio n. 3
0
def connect_to_glacier_get_vault(region=REGION, vault=VAULT_NAME):
    cn = glacier.connect_to_region(region)
    print 'available regions:', glacier.regions()
    vaults = cn.list_vaults()
    print 'available vaults in region:',  vaults
    print 'using', vault, 'vault in region', region
    if not vault in [v.name for v in vaults]:
        print 'vault', vault, 'does not exist, creating it...'
        return cn.create_vault(vault)
    else:
        return cn.get_vault(vault)
Esempio n. 4
0
#Make a dictionary of queues of stuff that remotes need to do
queues = dict()
#Make a dictionary of clients
live_clients = dict()
#Global variable to hold the current client
app.config['current_client'] = None

#Make a new static endpoint so that the path gets set goodly
app.static_url_path = app.config.get("URL_PREFIX","")+'/static'
app.static_folder='static'
app.add_url_rule(app.static_url_path + '/<path:filename>',endpoint='static',view_func=app.send_static_file)

#Make the database handler
db = SQLAlchemy(app)
db.create_all()

#Make a dictionary to hold handlers for glacier
handlers = dict()
for region in glacier.regions():
  handlers[region.name] = None

#Has the current config been validated?
validated_glacier=False
validated_db=False

#Import views
import WebGlacier.views
import WebGlacier.api.region_methods
import WebGlacier.api.vault_methods
import WebGlacier.api.communication
Esempio n. 5
0
#Make a dictionary of clients
live_clients = dict()
#Global variable to hold the current client
app.config['current_client'] = None

#Make a new static endpoint so that the path gets set goodly
app.static_url_path = app.config.get("URL_PREFIX", "") + '/static'
app.static_folder = 'static'
app.add_url_rule(app.static_url_path + '/<path:filename>',
                 endpoint='static',
                 view_func=app.send_static_file)

#Make the database handler
db = SQLAlchemy(app)
db.create_all()

#Make a dictionary to hold handlers for glacier
handlers = dict()
for region in glacier.regions():
    handlers[region.name] = None

#Has the current config been validated?
validated_glacier = False
validated_db = False

#Import views
import WebGlacier.views
import WebGlacier.api.region_methods
import WebGlacier.api.vault_methods
import WebGlacier.api.communication