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")
|
||||
"""
|
||||
result = execute_script(_var, _cmd, "list")
|
||||
if not isinstance(result, str):
|
||||
return []
|
||||
result = result.splitlines()
|
||||
result.pop(0)
|
||||
counter = 0
|
||||
for i in result:
|
||||
i = i.replace("- ", "")
|
||||
result[counter] = i
|
||||
counter += 1
|
||||
return result
|
||||
if not result:
|
||||
return []
|
||||
return [line.replace("- ", "") for line in result[1:]]
|
||||
|
||||
def backup(name: str) -> bool:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user