mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
feat(ssh_tunnel): Add feature flag to SSH Tunnel API (#22805)
This commit is contained in:
committed by
GitHub
parent
0045816772
commit
d6a4a5da79
@@ -19,10 +19,12 @@ from typing import Optional
|
||||
|
||||
from flask_appbuilder.models.sqla import Model
|
||||
|
||||
from superset import is_feature_enabled
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.dao.exceptions import DAODeleteFailedError
|
||||
from superset.databases.ssh_tunnel.commands.exceptions import (
|
||||
SSHTunnelDeleteFailedError,
|
||||
SSHTunnelingNotEnabledError,
|
||||
SSHTunnelNotFoundError,
|
||||
)
|
||||
from superset.databases.ssh_tunnel.dao import SSHTunnelDAO
|
||||
@@ -37,6 +39,8 @@ class DeleteSSHTunnelCommand(BaseCommand):
|
||||
self._model: Optional[SSHTunnel] = None
|
||||
|
||||
def run(self) -> Model:
|
||||
if not is_feature_enabled("SSH_TUNNELING"):
|
||||
raise SSHTunnelingNotEnabledError()
|
||||
self.validate()
|
||||
try:
|
||||
ssh_tunnel = SSHTunnelDAO.delete(self._model)
|
||||
|
||||
Reference in New Issue
Block a user