(self, user, script_name)
| 224 | @requires_admin_rights |
| 225 | @inject_user |
| 226 | def get(self, user, script_name): |
| 227 | try: |
| 228 | loaded_script = self.application.config_service.load_script_code(script_name, user) |
| 229 | except ConfigNotAllowedException: |
| 230 | LOGGER.warning('Admin access to the script "' + script_name + '" is denied for ' + user.get_audit_name()) |
| 231 | respond_error(self, 403, 'Access to the script is denied') |
| 232 | return |
| 233 | except InvalidFileException as e: |
| 234 | LOGGER.warning('Failed to load script code for script ' + script_name, exc_info=True) |
| 235 | respond_error(self, 422, str(e)) |
| 236 | return |
| 237 | except InvalidAccessException as e: |
| 238 | raise tornado.web.HTTPError(403, reason=str(e)) |
| 239 | |
| 240 | if loaded_script is None: |
| 241 | raise tornado.web.HTTPError(404, str('Failed to find config for name: ' + script_name)) |
| 242 | |
| 243 | self.write(json.dumps(loaded_script)) |
| 244 | |
| 245 | |
| 246 | class ScriptStop(BaseRequestHandler): |
nothing calls this directly
no test coverage detected