Commit 2fa6b83f authored by Efthymia Bika's avatar Efthymia Bika

Log timeview calls

parent 76db61c7
......@@ -325,7 +325,7 @@ function call_duplicity(mode, backup_set, force) {
}
} else if(mode == "timeview") {
if(code == 0) {
parse_collection_status(output_str);
parse_collection_status(output_str, log_file);
} else if(code == DUP_ERR_CODES.CONNECTION_FAILED) {
show_cloud_error();
}
......
......@@ -132,6 +132,8 @@ function fill_breadcrumbs(path) {
}
var selected_date = "";
var log_file_g = null;
function get_contents_by_date(value) {
$("#loader").show();
if(selected_date) {
......@@ -164,12 +166,13 @@ function get_contents_by_date(value) {
var args = ["python", TIMEVIEW_PATH, datapath,
"swift://" + container, cert, BAAS_ARCHIVE_DIR,
GPG_DIR, backup_name, "get", value, time_path];
GPG_DIR, log_file_g, backup_name, "get", value, time_path];
execFile(ENV_CMD, args, {env: make_env()}, show_contents_by_date);
}
function parse_collection_status(data) {
function parse_collection_status(data, log_file) {
log_file_g = log_file;
var datetime_reg = /\d{4}-\d{2}-\d{2}.\d{2}:\d{2}:\d{2}\s+\d+/g;
var dates = data.match(datetime_reg);
var dates_list = "";
......
......@@ -86,6 +86,7 @@ def fetch_timepoint(config, timepoint):
'--ssl-cacert-file', config['cacert_file'],
'--archive-dir', config['archive_dir'],
'--gpg-homedir', config['gpg_homedir'],
'--log-file', config['log_file'],
'--name', config['backup_name'],
config['target_url']]
......@@ -155,38 +156,40 @@ def get_config():
def main():
from sys import argv, stdin, stdout
def help():
print "Usage: %s <datapath> <target_url> <cacert_file> <archive_dir> <gpg_homedir> <backup_name> [get <absolute_timepoint> <path> | list]" % argv[0]
print "Usage: %s <datapath> <target_url> <cacert_file> <archive_dir> <gpg_homedir> <log_file> <backup_name> [get <absolute_timepoint> <path> | list]" % argv[0]
raise SystemExit(1)
if len(argv) < 8:
if len(argv) < 9:
help()
datapath = argv[1]
ensure_datapath(datapath)
target_url = argv[2]
cmd = argv[7]
cmd = argv[8]
if cmd not in ['get', 'list']:
help()
cacert_file = argv[3]
archive_dir = argv[4]
gpg_homedir = argv[5]
backup_name = argv[6]
log_file = argv[6]
backup_name = argv[7]
#config = get_config()
config = {'datapath': datapath,
'target_url': target_url,
'cacert_file': cacert_file,
'archive_dir': archive_dir,
'gpg_homedir': gpg_homedir,
'log_file': log_file,
'backup_name': backup_name}
if cmd == 'get':
if len(argv) < 10:
if len(argv) < 11:
help()
timepoint = argv[8]
path = unicode(argv[9], encoding='UTF-8')
timepoint = argv[9]
path = unicode(argv[10], encoding='UTF-8')
r = get_timepoint(config, timepoint, path)
print json.dumps(r, indent=2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment