aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/moon_secrouter
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2017-07-03 14:44:36 +0200
committerasteroide <thomas.duval@orange.com>2017-07-03 14:44:36 +0200
commita556730888e127b413025e41f98e2a89d8299706 (patch)
tree757f11e797ac37705e320913bfd05fd7969a744a /moonv4/moon_secrouter
parent8a7005ce22d94bd65f04e22ab575a8195b0c2ba7 (diff)
Update the communications between master and slave
Change-Id: I08f0d588f8e009cb6f25f3fe71d8df79d6dfbaf1
Diffstat (limited to 'moonv4/moon_secrouter')
-rw-r--r--moonv4/moon_secrouter/moon_secrouter/api/route.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/moonv4/moon_secrouter/moon_secrouter/api/route.py b/moonv4/moon_secrouter/moon_secrouter/api/route.py
index 28a9a65f..2a2c54bc 100644
--- a/moonv4/moon_secrouter/moon_secrouter/api/route.py
+++ b/moonv4/moon_secrouter/moon_secrouter/api/route.py
@@ -135,6 +135,14 @@ class Cache(object):
def __update_pdp(self):
pdp = call("moon_manager", method="get_pdp", ctx={"user_id": "admin"}, args={})
+ if not pdp["pdps"]:
+ LOG.info("Updating PDP through master")
+ pdp = call("moon_manager", method="get_pdp",
+ ctx={
+ "user_id": "admin",
+ 'call_master': True
+ },
+ args={})
for _pdp in pdp["pdps"].values():
if _pdp['keystone_project_id'] not in self.__CONTAINER_CHAINING:
self.__CONTAINER_CHAINING[_pdp['keystone_project_id']] = {}
@@ -418,6 +426,11 @@ class Router(object):
return call(component, method=ctx["method"], ctx=ctx, args=args)
if component == "manager":
result = call("moon_manager", method=ctx["method"], ctx=ctx, args=args)
+ if ctx["method"] == "get_pdp":
+ _ctx = copy.deepcopy(ctx)
+ _ctx["call_master"] = True
+ result2 = call("moon_manager", method=ctx["method"], ctx=_ctx, args=args)
+ result["pdps"].update(result2["pdps"])
self.send_update(api=ctx["method"], ctx=ctx, args=args)
return result
if component == "function":