From 553ebe5ab8811d2709afbf346e055f5a083080a1 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sun, 14 Apr 2019 08:21:51 +0200 Subject: [PATCH] core: added getNamespace method to retrieve a namespace from short name. --- sat/core/sat_main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sat/core/sat_main.py b/sat/core/sat_main.py index ca513e28..6a9ef947 100644 --- a/sat/core/sat_main.py +++ b/sat/core/sat_main.py @@ -613,6 +613,13 @@ class SAT(service.Service): def getNamespaces(self): return self.ns_map + def getNamespace(self, short_name): + try: + return self.ns_map[short_name] + except KeyError: + raise exceptions.NotFound(u"namespace {short_name} is not registered" + .format(short_name=short_name)) + def getSessionInfos(self, profile_key): """compile interesting data on current profile session""" client = self.getClient(profile_key)