def _store_db(path, url, filename): """ Special case of store. DB files need to be handled differently """ path = os.path.join(path, filename) url = "{}/{}".format(url, filename) res, err, msg = storage_iface.copy_local_to_storage(path, url) if err: msg = "Error storing DB from {}, to {}, file {}: {}".format(url, path, filename, res) return err, msg
def store(state, path, suburl, atype): """ Store local file to remote storge """ filename = os.path.basename(path) url = build_url(state, suburl, filename) result, err, msg = storage_iface.copy_local_to_storage(path, url) if err: msg = "Error storing from {}, to {}: {}".format(path, url, msg) else: # Add size to stats _increment_stored_stats(state, atype, os.stat(path).st_size) return err, msg