@@ -727,7 +727,7 @@ def stop(entity: str, name: str, id: int = -1, ip: str = "") -> None:
727
727
stop_statsmanager (ip = ip )
728
728
elif entity == "emulation_executions" :
729
729
stop_emulation_executions ()
730
- elif entity == "hostmanager " :
730
+ elif entity == "hostmanagers " :
731
731
stop_host_managers (ip = ip , emulation = name , ip_first_octet = id )
732
732
else :
733
733
container_stopped = False
@@ -914,16 +914,15 @@ def stop_host_managers(ip: str, emulation: str, ip_first_octet: int) -> None:
914
914
config = MetastoreFacade .get_config (id = 1 )
915
915
for node in config .cluster_config .cluster_nodes :
916
916
if node .ip == ip or ip == "" :
917
- stopped = ClusterController .stop_host_managers (ip = ip , port = constants .GRPC_SERVERS .CLUSTER_MANAGER_PORT ,
918
- emulation = emulation , ip_first_octet = ip_first_octet )
917
+ stopped = ClusterController .stop_host_managers (ip = ip , port = constants .GRPC_SERVERS .CLUSTER_MANAGER_PORT ,
918
+ emulation = emulation , ip_first_octet = ip_first_octet )
919
919
if stopped :
920
920
click .secho (f"Stopping host managers on port:{ constants .GRPC_SERVERS .CLUSTER_MANAGER_PORT } " )
921
921
else :
922
922
click .secho (f"Host managers are not stopped:{ constants .GRPC_SERVERS .CLUSTER_MANAGER_PORT } " ,
923
923
bold = False )
924
924
925
925
926
-
927
926
@click .argument ('max_workers' , default = 10 , type = int )
928
927
@click .argument ('log_file' , default = "docker_statsmanager.log" , type = str )
929
928
@click .argument ('log_dir' , default = "/var/log/csle" , type = str )
@@ -1341,16 +1340,16 @@ def start_statsmanager(ip: str) -> None:
1341
1340
if node .ip == ip or ip == "" :
1342
1341
ClusterController .start_docker_statsmanager (ip = node .ip , port = constants .GRPC_SERVERS .CLUSTER_MANAGER_PORT )
1343
1342
1343
+
1344
1344
def start_host_manager (ip : str , emulation : str , ip_first_octet : int ):
1345
1345
"""
1346
- Utility function for starting host manager
1346
+ Utility function for starting host manager
1347
1347
1348
- :param ip: the ip of the node to start host manager
1349
- :param emulation: the emulation of the execution
1350
- :param ip_first_octet: the ID of the execution
1351
-
1352
- :return: None
1353
- """
1348
+ :param ip: the ip of the node to start host manager
1349
+ :param emulation: the emulation of the execution
1350
+ :param ip_first_octet: the ID of the execution
1351
+ :return: None
1352
+ """
1354
1353
import csle_common .constants .constants as constants
1355
1354
from csle_common .metastore .metastore_facade import MetastoreFacade
1356
1355
config = MetastoreFacade .get_config (id = 1 )
@@ -1746,24 +1745,26 @@ def ls(entity: str, all: bool, running: bool, stopped: bool, ip: str, name: str,
1746
1745
else :
1747
1746
click .secho (f"entity: { entity } is not recognized" , fg = "red" , bold = True )
1748
1747
1749
- def list_host_managers (ip : str , emulation : str , ip_first_octet : int ) -> None :
1748
+
1749
+ def list_host_managers (ip : str , emulation : str , ip_first_octet : int ) -> None :
1750
1750
"""
1751
- Utility function for listing host managers
1751
+ Utility function for listing host managers
1752
1752
1753
- :param ip: the ip of the node to start host manager
1754
- :param emulation: the emulation of the execution
1755
- :param ip_first_octet: the ID of the execution
1753
+ :param ip: the ip of the node to start host manager
1754
+ :param emulation: the emulation of the execution
1755
+ :param ip_first_octet: the ID of the execution
1756
1756
1757
- :return: None
1758
- """
1757
+ :return: None
1758
+ """
1759
1759
import csle_common .constants .constants as constants
1760
1760
from csle_common .metastore .metastore_facade import MetastoreFacade
1761
1761
config = MetastoreFacade .get_config (id = 1 )
1762
1762
for node in config .cluster_config .cluster_nodes :
1763
1763
if node .ip == ip or ip == "" :
1764
- host_manage_info = ClusterController .get_host_managers_info (ip = ip , port = constants .GRPC_SERVERS .CLUSTER_MANAGER_PORT ,
1765
- emulation = emulation , ip_first_octet = ip_first_octet )
1766
- host_managers = host_manage_info .hostManagersStatuses
1764
+ host_manager_info = ClusterController .get_host_managers_info (
1765
+ ip = ip , port = constants .GRPC_SERVERS .CLUSTER_MANAGER_PORT , emulation = emulation ,
1766
+ ip_first_octet = ip_first_octet )
1767
+ host_managers = host_manager_info .hostManagersStatuses
1767
1768
1768
1769
click .secho ('+' + '-' * 50 + '+' , fg = 'white' )
1769
1770
click .secho (f'|{ "Host IP" :^30} |{ "Running Status" :^19} |' , fg = 'white' )
0 commit comments