Commit 0bf6d138 authored by Jiahang Chen's avatar Jiahang Chen
Browse files

ADD: judgement statement to callback function

parent ac34cd82
Pipeline #365899 passed with stages
in 1 minute and 6 seconds
......@@ -307,13 +307,19 @@ def on_get_value_request(self, msg):
receiver_endpoints=[request_sender_endpoint],
msg=json.dumps(get_value_reply.msg),
)
if self.__is_broker_rest:
if res.status_code == 201:
print(
BColors.OKBLUE
+ "[S³I][Broker]"
+ BColors.ENDC
+ ": Send a S³I-B GetValueReply back to the requester."
+ ": Send a S³I-B GetValueReply back to the requester "
)
else:
print(BColors.OKBLUE
+ "[S³I][Broker]"
+ BColors.ENDC
+ res.text)
def _uriToData(self, uri):
if uri == "":
......@@ -439,6 +445,7 @@ def on_service_request(self, body_json):
res = self.broker.send(receiver_endpoints=[body_json.get("replyToEndpoint", None)],
msg=json.dumps(service_reply.msg))
if self.__is_broker_rest:
if res.status_code == 201:
print(
BColors.OKBLUE
......@@ -446,6 +453,11 @@ def on_service_request(self, body_json):
+ BColors.ENDC
+ ": Send a S³I-B ServiceReply back to the requester "
)
else:
print( BColors.OKBLUE
+ "[S³I][Broker]"
+ BColors.ENDC
+ res.text)
def on_get_value_reply(self, msg):
print(
......
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