Skip to content
Snippets Groups Projects
Commit 0bf6d138 authored by Jiahang Chen's avatar Jiahang Chen
Browse files

ADD: judgement statement to callback function

parent ac34cd82
No related branches found
No related tags found
No related merge requests found
Pipeline #365899 passed
......@@ -307,13 +307,19 @@ def on_get_value_request(self, msg):
receiver_endpoints=[request_sender_endpoint],
msg=json.dumps(get_value_reply.msg),
)
if res.status_code == 201:
print(
BColors.OKBLUE
+ "[S³I][Broker]"
+ BColors.ENDC
+ ": Send a S³I-B GetValueReply back to the requester."
)
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 "
)
else:
print(BColors.OKBLUE
+ "[S³I][Broker]"
+ BColors.ENDC
+ res.text)
def _uriToData(self, uri):
if uri == "":
......@@ -439,13 +445,19 @@ 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 res.status_code == 201:
print(
BColors.OKBLUE
+ "[S³I][Broker]"
+ BColors.ENDC
+ ": Send a S³I-B ServiceReply back to the requester "
)
if self.__is_broker_rest:
if res.status_code == 201:
print(
BColors.OKBLUE
+ "[S³I][Broker]"
+ 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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment