def create_vault(): if 'name' not in request.args: abort(401) hand = get_handler() try: hand.create_vault(request.args['name']) vault = process_vault(hand.describe_vault(request.args['name'])) except UnexpectedHTTPResponseError as e: print "Failed to create vault. Error message was %s"%e.message return redirect(url_for('main'))
def get_vaults(): """ Queries the Amazon API and gets a list of all the jobs, which is used to populate and/or update the local database. """ handler = get_handler() try: vaults=handler.list_vaults() for vault in vaults["VaultList"]: tmp=process_vault(vault) except UnexpectedHTTPResponseError as e: print "Failed processing/loading vaults. Error was %s"%e.message return redirect(url_for("main"))