Skip to content
Snippets Groups Projects
Commit d4540763 authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

paramiko optional fix

parent 57436d3e
No related branches found
No related tags found
No related merge requests found
...@@ -388,6 +388,8 @@ class Simulation(object): ...@@ -388,6 +388,8 @@ class Simulation(object):
def set_id(self, *args, **kwargs): def set_id(self, *args, **kwargs):
pass pass
def progress_callback(self,*args, **kwargs):
pass
class UpdateSimStatusThread(Thread): class UpdateSimStatusThread(Thread):
def __init__(self, simulation, interval=1): def __init__(self, simulation, interval=1):
......
...@@ -16,12 +16,11 @@ import time ...@@ -16,12 +16,11 @@ import time
from wetb.hawc2 import log_file from wetb.hawc2 import log_file
from wetb.hawc2.log_file import LogInfo, LogFile from wetb.hawc2.log_file import LogInfo, LogFile
from wetb.hawc2.simulation import ERROR, ABORTED from wetb.hawc2.simulation import ERROR, ABORTED
from wetb.utils.cluster_tools import pbsjob
from wetb.utils.cluster_tools.cluster_resource import LocalResource, \ from wetb.utils.cluster_tools.cluster_resource import LocalResource, \
SSHPBSClusterResource, unix_path SSHPBSClusterResource
from wetb.utils.cluster_tools import pbsjob
from wetb.utils.cluster_tools.pbsjob import SSHPBSJob, NOT_SUBMITTED, DONE from wetb.utils.cluster_tools.pbsjob import SSHPBSJob, NOT_SUBMITTED, DONE
from wetb.utils.cluster_tools.ssh_client import SSHClient
from wetb.utils.timing import print_time
from wetb.hawc2.htc_file import fmt_path from wetb.hawc2.htc_file import fmt_path
import numpy as np import numpy as np
...@@ -249,7 +248,8 @@ class GormSimulationResource(PBSClusterSimulationResource): ...@@ -249,7 +248,8 @@ class GormSimulationResource(PBSClusterSimulationResource):
def __init__(self, username, password, wine_cmd="WINEARCH=win32 WINEPREFIX=~/.wine32 wine"): def __init__(self, username, password, wine_cmd="WINEARCH=win32 WINEPREFIX=~/.wine32 wine"):
init_cmd = """export PATH=/home/python/miniconda3/bin:$PATH init_cmd = """export PATH=/home/python/miniconda3/bin:$PATH
source activate wetb_py3""" source activate wetb_py3"""
PBSClusterSimulationResource.__init__(self, "gorm.risoe.dk", username, password, 22, 25, 100, init_cmd, wine_cmd, "python") from wetb.utils.cluster_tools.ssh_client import SSHClient
PBSClusterSimulationResource.__init__(self, SSHClient('gorm.risoe.dk', username, password, 22), 25, 100, init_cmd, wine_cmd, "python")
class PBSClusterSimulationHost(SimulationHost): class PBSClusterSimulationHost(SimulationHost):
......
...@@ -119,6 +119,10 @@ class SSHPBSClusterResource(Resource): ...@@ -119,6 +119,10 @@ class SSHPBSClusterResource(Resource):
@property @property
def host(self): def host(self):
return self.ssh.host return self.ssh.host
@property
def username(self):
return self.ssh.username
def new_ssh_connection(self): def new_ssh_connection(self):
......
...@@ -4,7 +4,6 @@ Created on 04/12/2015 ...@@ -4,7 +4,6 @@ Created on 04/12/2015
@author: mmpe @author: mmpe
''' '''
import os import os
from wetb.utils.cluster_tools.ssh_client import SSHClient
NOT_SUBMITTED = "Job not submitted" NOT_SUBMITTED = "Job not submitted"
PENDING = "Pending" PENDING = "Pending"
...@@ -38,7 +37,6 @@ class SSHPBSJob(object): ...@@ -38,7 +37,6 @@ class SSHPBSJob(object):
@property @property
def status(self): def status(self):
if self._status in [NOT_SUBMITTED, DONE]: if self._status in [NOT_SUBMITTED, DONE]:
return self._status return self._status
with self.ssh: with self.ssh:
......
...@@ -6,10 +6,7 @@ Created on 27/11/2015 ...@@ -6,10 +6,7 @@ Created on 27/11/2015
from io import StringIO from io import StringIO
import sys import sys
try: import paramiko
import paramiko
except Exception as e:
sys.stderr.write("Paramiko(ssh client module) not imported\n%s"%str(e) )
import os import os
import threading import threading
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment