Exemplo n.º 1
0
            def callback(app_name):
                try:
                    url = "http://%s:%s/%s/backup" % (HOST, PORT, app_name)
                    progress = get_backup_progress(app_name)

                    if not progress:
                        urllib2.urlopen(url).read()
                except Exception, e:
                    logger.debug("%r", e)
Exemplo n.º 2
0
    def backup_progress(app_name):
        """
        Return from db the progress of the backup routine.
        """
        progress = get_backup_progress(app_name)

        if progress:
            if not progress.ended_at:
                return make_response(jsonify({"status": True, "progress": progress.progress}))

        return make_response(jsonify({"status": False, "progress": 0}))