def file_del(): path = get_file_path(json.loads(request.data)['file']) try: docker_interface.file_rm(session['user_container_name'], path, True) return get_pkg_tree() except: # catch *all* exceptions app.logger.error("Unable to delete file. " + str(sys.exc_info()[0])) raise PackageError("An internal error occurred.")
def pkg_del(packageName=None): pkgName = packageName if pkgName is None: pkgName = session['pkg'] try: docker_interface.file_rm(session['user_container_name'], pkgName, True) except: # catch *all* exceptions app.logger.error("Unable to delete package. " + str(sys.exc_info()[0])) raise PackageError("An internal error occurred.") return jsonify(success=1)
def delete_pkg(package_name=None): pkg_name = _check_pkg_name_and_if_none_get_pkg_name_from_session( package_name) try: docker_interface.file_rm(session['user_container_name'], pkg_name, True) except Exception: # catch *all* exceptions _log_unable_to_delete_pkg_error() raise PackageError("An internal error occurred.") return jsonify(success=1)
def pkg_del(packageName=None): pkgName = packageName if pkgName is None: pkgName = session['pkg'] docker_interface.file_rm(session['user_container_name'], pkgName, True) return jsonify(result=None)
def file_del(): path = get_file_path(json.loads(request.data)['file']) docker_interface.file_rm(session['user_container_name'], path, True) return get_pkg_tree()
def _remove_file_from_user_container(path): docker_interface.file_rm(session['user_container_name'], path, True)