changed default for return_list in api.path

This commit is contained in:
tomaae 2020-04-04 21:43:19 +02:00
parent 1ec4e13eb8
commit f489259908
2 changed files with 13 additions and 13 deletions

View file

@ -167,7 +167,7 @@ class MikrotikAPI:
# ---------------------------
# path
# ---------------------------
def path(self, path, return_list=False) -> Optional(list):
def path(self, path, return_list=True) -> Optional(list):
"""Retrieve data from Mikrotik API."""
"""Returns generator object, unless return_list passed as True"""
if not self._connected or not self._connection:
@ -251,7 +251,7 @@ class MikrotikAPI:
if not self.connect():
return False
response = self.path(path)
response = self.path(path, return_list=False)
if response is None:
return False
@ -328,7 +328,7 @@ class MikrotikAPI:
if not self.connect():
return False
response = self.path("/system/script")
response = self.path("/system/script", return_list=False)
if response is None:
return False
@ -404,7 +404,7 @@ class MikrotikAPI:
if not self.connect():
return None
response = self.path("/interface")
response = self.path("/interface", return_list=False)
if response is None:
return None