Esempio n. 1
0
 def do_the_destroys(result):
     tile_ids = result["tile_ids"]
     for tile_id in tile_ids:
         destroy_container(tile_id)
         send_direct_request_to_container(megaplex_id, "deregister_container", {"container_id": tile_id})
     destroy_container(main_id)
     send_direct_request_to_container(megaplex_id, "deregister_container", {"container_id": main_id})
Esempio n. 2
0
 def kill_container(self, container_id):
     if not (current_user.get_id() == repository_user.get_id()):
         return jsonify({"success": False, "message": "not authorized", "alert_type": "alert-warning"})
     try:
         destroy_container(container_id)
     except Exception as ex:
         template = "<pre>An exception of type {0} occured. Arguments:\n{1!r}</pre>"
         error_string = template.format(type(ex).__name__, ex.args)
         error_string += traceback.format_exc()
         return jsonify({"success": False, "message": error_string, "alert_type": "alert-warning"})
     self.update_selector_list()
     return jsonify({"success": True, "message": "Container Destroeyd", "alert_type": "alert-success"})