Skip to content
Snippets Groups Projects
Commit 171d9047 authored by shinedday's avatar shinedday
Browse files

Fix update

parent 531d0e6a
Branches
Tags
No related merge requests found
No preview for this file type
...@@ -57,7 +57,7 @@ class Amas(Schedulable, SSHClient): ...@@ -57,7 +57,7 @@ class Amas(Schedulable, SSHClient):
if args is None: if args is None:
args = [] args = []
command = "nohup python " command = "nohup python "
command += "\"Desktop/mqtt_goyon/iotamak-core/" + experience_name + "/agent.py\" " command += "\"Desktop/mqtt_goyon/example/" + experience_name + "/agent.py\" "
command += str(self.next_id) + " \"" command += str(self.next_id) + " \""
command += str(self.broker_ip) + "\" " command += str(self.broker_ip) + "\" "
for arg in args: for arg in args:
......
...@@ -80,8 +80,6 @@ class Ihm(MqttClient, SSHClient): ...@@ -80,8 +80,6 @@ class Ihm(MqttClient, SSHClient):
self.loading() self.loading()
self.ping() self.ping()
if self.ping_is_true:
self.agent()
while not exit_bool: while not exit_bool:
...@@ -144,6 +142,9 @@ class Ihm(MqttClient, SSHClient): ...@@ -144,6 +142,9 @@ class Ihm(MqttClient, SSHClient):
self.update(self.experiment_name) self.update(self.experiment_name)
if cmd.lower() == "agent":
self.agent()
# Crée les processus amas/env/scheduler de l'experience chargé # Crée les processus amas/env/scheduler de l'experience chargé
if cmd.lower() == "start": if cmd.lower() == "start":
......
...@@ -50,7 +50,13 @@ class SSHClient: ...@@ -50,7 +50,13 @@ class SSHClient:
transport.connect(username=client.user, password=client.password) transport.connect(username=client.user, password=client.password)
sftp = MySFTPClient.from_transport(transport) sftp = MySFTPClient.from_transport(transport)
sftp.mkdir("Desktop/mqtt_goyon/example/" + experiment_name, ignore_existing=True) sftp.mkdir("Desktop/mqtt_goyon/example/" + experiment_name, ignore_existing=True)
sftp.put_dir("../"+experiment_name, "Desktop/mqtt_goyon/example/" + experiment_name)
print(str(pathlib.Path().resolve()), "Desktop/mqtt_goyon/example/" + experiment_name)
sftp.put_dir(
str(pathlib.Path().resolve()),
"Desktop/mqtt_goyon/example/" + experiment_name
)
sftp.close() sftp.close()
class MySFTPClient(paramiko.SFTPClient): class MySFTPClient(paramiko.SFTPClient):
...@@ -62,7 +68,7 @@ class MySFTPClient(paramiko.SFTPClient): ...@@ -62,7 +68,7 @@ class MySFTPClient(paramiko.SFTPClient):
for item in os.listdir(source): for item in os.listdir(source):
if os.path.isfile(os.path.join(source, item)): if os.path.isfile(os.path.join(source, item)):
self.put(os.path.join(source, item), '%s/%s' % (target, item)) self.put(os.path.join(source, item), '%s/%s' % (target, item))
print(os.path.join(source, item)) print(os.path.join(target, item))
else: else:
if any([i in item for i in [".git", "__pycache__", ".idea", ".vscode"]]): if any([i in item for i in [".git", "__pycache__", ".idea", ".vscode"]]):
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment