Change-Id: I47bb40a5275c36c189cf6f8bf57a1bf6ec1f84b5
Issue-ID: VFC-1594
Signed-off-by: hongyuzhao <zhao.hongyu@zte.com.cn>
def check_callbackuri_connection(self):
logger.debug("SubscribeNotification-post::> Sending GET request "
"to %s" % self.callback_uri)
def check_callbackuri_connection(self):
logger.debug("SubscribeNotification-post::> Sending GET request "
"to %s" % self.callback_uri)
- try:
- response = requests.get(self.callback_uri, timeout=2)
- if response.status_code != status.HTTP_204_NO_CONTENT:
- raise NFLCMException("callbackUri %s returns %s status "
- "code." % (self.callback_uri, response.status_code))
- except Exception:
- raise NFLCMException("callbackUri %s didn't return 204 status"
- "code." % self.callback_uri)
+ retry_count = 3
+ while retry_count > 0:
+ response = requests.get(self.callback_uri, timeout=10)
+ if response.status_code == status.HTTP_204_NO_CONTENT:
+ return
+ logger.debug("callbackUri %s returns %s status code." % (self.callback_uri, response.status_code))
+ retry_count = - 1
+
+ raise NFLCMException("callbackUri %s didn't return 204 status." % self.callback_uri)
def do_biz(self):
self.subscription_id = str(uuid.uuid4())
def do_biz(self):
self.subscription_id = str(uuid.uuid4())
self.lcm_op_occ = VnfLcmOpOcc(
vnf_inst_id=nf_inst_id,
lcm_op_id=job_id,
self.lcm_op_occ = VnfLcmOpOcc(
vnf_inst_id=nf_inst_id,
lcm_op_id=job_id,
- operation=OPERATION_TYPE.SCALE,
- task=OPERATION_TASK.SCALE
+ operation=OPERATION_TYPE.TERMINATE,
+ task=OPERATION_TASK.TERMINATE
logger.info("Send Notifications to the callbackUri")
filters = {
"operationState": "operation_states",
logger.info("Send Notifications to the callbackUri")
filters = {
"operationState": "operation_states",
- "operation": "operation_types"
+ "operation": "operation_types",
+ "vnfInstanceId": "vnf_instance_filter"
}
subscriptions_filter = {v + "__contains": notification[k] for k, v in list(filters.items())}
}
subscriptions_filter = {v + "__contains": notification[k] for k, v in list(filters.items())}
{[testenv]commands}
[testenv:cov]
{[testenv]commands}
[testenv:cov]
commands = coverage xml --omit="*test*,*__init__.py,*site-packages*"
commands = coverage xml --omit="*test*,*__init__.py,*site-packages*"