mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-03 03:59:12 +00:00
Revert: remove Gettokens (#18908)
* Revert: remove Gettokens * test_conn_fixes
This commit is contained in:
parent
d634edb8f1
commit
cf61df2404
@ -152,24 +152,27 @@ class MSTRClient:
|
||||
def is_project_name(self) -> bool:
|
||||
return bool(self.config.projectName)
|
||||
|
||||
def list_projects(self) -> List[MstrProject]:
|
||||
"""
|
||||
Test if we can get the token and fetch projects
|
||||
"""
|
||||
self.get_auth_params()
|
||||
resp_projects = self.client.get(
|
||||
path="/projects",
|
||||
)
|
||||
return resp_projects
|
||||
|
||||
def get_projects_list(self) -> List[MstrProject]:
|
||||
"""
|
||||
Get List of all projects
|
||||
"""
|
||||
try:
|
||||
resp_projects = self.client.get(
|
||||
path="/projects",
|
||||
)
|
||||
|
||||
project_list = MstrProjectList(projects=resp_projects)
|
||||
project_list = MstrProjectList(projects=self.list_projects())
|
||||
return project_list.projects
|
||||
|
||||
except Exception as exc:
|
||||
logger.debug(traceback.format_exc())
|
||||
logger.warning(f"Failed to fetch the project list due to [{exc}]")
|
||||
|
||||
return []
|
||||
|
||||
def get_project_by_name(self) -> Optional[MstrProject]:
|
||||
"""
|
||||
Get Project By Name
|
||||
|
||||
@ -49,8 +49,7 @@ def test_connection(
|
||||
"""
|
||||
|
||||
test_fn = {
|
||||
"GetToken": client.get_auth_params,
|
||||
"GetProjects": client.get_projects_list,
|
||||
"GetProjects": client.list_projects,
|
||||
}
|
||||
|
||||
return test_connection_steps(
|
||||
|
||||
@ -3,13 +3,6 @@
|
||||
"displayName": "Mstr Test Connection",
|
||||
"description": "This Test Connection validates the access against the server and basic metadata extraction of dashboards and charts.",
|
||||
"steps": [
|
||||
{
|
||||
"name": "GetToken",
|
||||
"description": "Fetch the Auth Token",
|
||||
"errorMessage": "Failed to fetch auth token, please validate the credentials or if user has access to fetch token or if you are using the correct login mode",
|
||||
"shortCircuit": true,
|
||||
"mandatory": true
|
||||
},
|
||||
{
|
||||
"name": "GetProjects",
|
||||
"description": "List all the projects available to the user",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user