Skip to content

Commit 81a2568

Browse files
Merge pull request #47 from ninsbl/strds_support
Add basic STRDS support
2 parents a73325c + 14b42dd commit 81a2568

5 files changed

Lines changed: 937 additions & 217 deletions

File tree

src/actinia/actinia.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __check_version(self):
9292
self.__check_version()
9393
else:
9494
raise Exception(
95-
f"Connection to actinia server <{self.url}> failed!"
95+
"Connection to actinia server <%s> failed!", self.url
9696
)
9797

9898
def get_version(self):
@@ -148,9 +148,15 @@ def __request_locations(self):
148148
raise Exception("Authentication is not set.")
149149

150150
url = f"{self.url}/locations"
151-
loc_names = request_and_check(
151+
loc_response = request_and_check(
152152
"GET", url, **{"timeout": self.timeout, "auth": (self.__auth)}
153-
)["locations"]
153+
)
154+
loc_names = loc_response.get("locations") or loc_response.get(
155+
"projects"
156+
)
157+
if not loc_names:
158+
raise Exception("Authentication is not set.")
159+
154160
loc = {
155161
lname: Location(lname, self, self.__auth) for lname in loc_names
156162
}

0 commit comments

Comments
 (0)