fix: Improve tenant listing by handling non-string results and simplifying list processing
This commit is contained in:
@@ -375,14 +375,12 @@ class instace:
|
|||||||
- list with all tenants ("tenant1", "tenant2")
|
- list with all tenants ("tenant1", "tenant2")
|
||||||
"""
|
"""
|
||||||
result = execute_script(_var, _cmd, "list")
|
result = execute_script(_var, _cmd, "list")
|
||||||
|
if not isinstance(result, str):
|
||||||
|
return []
|
||||||
result = result.splitlines()
|
result = result.splitlines()
|
||||||
result.pop(0)
|
if not result:
|
||||||
counter = 0
|
return []
|
||||||
for i in result:
|
return [line.replace("- ", "") for line in result[1:]]
|
||||||
i = i.replace("- ", "")
|
|
||||||
result[counter] = i
|
|
||||||
counter += 1
|
|
||||||
return result
|
|
||||||
|
|
||||||
def backup(name: str) -> bool:
|
def backup(name: str) -> bool:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user