diff --git a/src/drunc/apps/fake_daqapp_rest.py b/src/drunc/apps/fake_daqapp_rest.py index 846d07010..cc403c95a 100644 --- a/src/drunc/apps/fake_daqapp_rest.py +++ b/src/drunc/apps/fake_daqapp_rest.py @@ -229,7 +229,9 @@ def main(): help="This is a dummy argument in this case", ) parser.add_argument("-s", "--session", default="test", help="name of session") - parser.add_argument("-k", "--configurationID", default="test-config", help="ID of session") + parser.add_argument( + "-k", "--configurationID", default="test-config", help="ID of session" + ) args = parser.parse_args() diff --git a/src/drunc/connectivity_service/client.py b/src/drunc/connectivity_service/client.py index 87361690b..1140e1230 100644 --- a/src/drunc/connectivity_service/client.py +++ b/src/drunc/connectivity_service/client.py @@ -72,7 +72,7 @@ def is_ready(self, timeout: int = 10): def retract(self, uid, fail_quickly=False): data = { - "partition": self.session, + "session": self.session, #! will likely need to change "connections": [ { "connection_id": uid, @@ -120,11 +120,11 @@ def retract(self, uid, fail_quickly=False): if fail_quickly: return - def retract_partition( + def retract_session( self, fail_quickly: bool = False, fail_quietly: bool = False ) -> None: """ - Retract the whole partition (session) from the connectivity service. + Retract the whole session from the connectivity service. Args: fail_quickly (bool): If True, the function will return immediately on failure without @@ -132,7 +132,7 @@ def retract_partition( fail_quietly (bool): If True, the function will suppress all exceptions and log errors as warnings. Default is False. """ - data = {"partition": self.session} + data = {"session": self.session} #! will likely need to change for i in range(50): try: self.log.debug( @@ -140,7 +140,7 @@ def retract_partition( ) r = http_post( - self.address + "/retract-partition", + self.address + "/retract-session", data=data, headers={"Content-Type": "application/json"}, as_json=True, @@ -222,7 +222,7 @@ def publish(self, uid, uri, data_type: str): http_post( self.address + "/publish", data={ - "partition": self.session, + "session": self.session, #! will likely need to change "connections": [ { "connection_type": 0, diff --git a/src/drunc/controller/interface/controller.py b/src/drunc/controller/interface/controller.py index 4eadef8a2..bb67ce28d 100644 --- a/src/drunc/controller/interface/controller.py +++ b/src/drunc/controller/interface/controller.py @@ -131,7 +131,7 @@ def kill_me(sig, frame): log_km = get_logger("controller.iface.kill_me") log_km.info("Sending SIGKILL") if ctrlr.top_segment_controller: - ctrlr.connectivity_service.retract_partition(fail_quickly=True) + ctrlr.connectivity_service.retract_session(fail_quickly=True) pgrp = os.getpgid(os.getpid()) os.killpg(pgrp, signal.SIGKILL) diff --git a/src/drunc/unified_shell/shell.py b/src/drunc/unified_shell/shell.py index a3dfd1678..90d898963 100644 --- a/src/drunc/unified_shell/shell.py +++ b/src/drunc/unified_shell/shell.py @@ -488,7 +488,7 @@ def cleanup(): ctx.obj.session_name, connectivity_service_address ) try: - csc.retract_partition(fail_quickly=True, fail_quietly=True) + csc.retract_session(fail_quickly=True, fail_quietly=True) unified_shell_log.debug( "Session retracted from the connectivity service" )