Commit 5c3ec017 authored by Yusei Tahara's avatar Yusei Tahara

erp5/util/testnode: hosting subscription url was not updated once it was set....

erp5/util/testnode: hosting subscription url was not updated once it was set. As a result, since testnode watched an old destroyed instance, the next test never started. Thus don't store hosting subscription url. It changes from time to time.
parent 7139133a
...@@ -67,7 +67,6 @@ class SlapOSMasterCommunicator(object): ...@@ -67,7 +67,6 @@ class SlapOSMasterCommunicator(object):
self.slap_order = slap_order self.slap_order = slap_order
self.slap_supply = slap_supply self.slap_supply = slap_supply
self.hateoas_navigator = self.slap._hateoas_navigator self.hateoas_navigator = self.slap._hateoas_navigator
self.hosting_subscription_url = None
if url is not None and \ if url is not None and \
url.startswith(SOFTWARE_PRODUCT_NAMESPACE): url.startswith(SOFTWARE_PRODUCT_NAMESPACE):
...@@ -183,18 +182,19 @@ class SlapOSMasterCommunicator(object): ...@@ -183,18 +182,19 @@ class SlapOSMasterCommunicator(object):
@retryOnNetworkFailure @retryOnNetworkFailure
def getInstanceUrlList(self): def getInstanceUrlList(self):
if self.hosting_subscription_url is None: hosting_subscription_dict = self.hateoas_navigator._hateoas_getHostingSubscriptionDict()
hosting_subscription_dict = self.hateoas_navigator._hateoas_getHostingSubscriptionDict() # Don't store hosting subscription url. It changes from time to time.
for hs in hosting_subscription_dict: hosting_subscription_url = None
if hs['title'] == self.name: for hs in hosting_subscription_dict:
self.hosting_subscription_url = hs['href'] if hs['title'] == self.name:
break hosting_subscription_url = hs['href']
break
if self.hosting_subscription_url is None:
if hosting_subscription_url is None:
return None return None
return self.hateoas_navigator.getHateoasInstanceList( return self.hateoas_navigator.getHateoasInstanceList(
self.hosting_subscription_url) hosting_subscription_url)
@retryOnNetworkFailure @retryOnNetworkFailure
def getNewsFromInstance(self, url): def getNewsFromInstance(self, url):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment