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

improved error messages in hawc2 simulation

parent 5364f6ed
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,6 @@ standard_library.install_aliases()
if __name__=="__main__":
from build_exe.cx.build_cx_exe import NUMPY
from build_exe.cx import build_cx_exe
from mmpe.build_exe.cx.build_cx_exe import NUMPY
from mmpe.build_exe.cx import build_cx_exe
build_cx_exe.build_exe("ascii2bin.py", version="3.0.1", includes=["'pandas'"], modules=['email', NUMPY])
......@@ -43,13 +43,21 @@ class HTCFile(HTCContents, HTCDefaults):
modelpath = "../"
initial_comments = None
_contents = None
def __init__(self, filename=None, relative_modelpath="../"):
def __init__(self, filename=None, modelpath="../"):
"""
Parameters
---------
filename : str
Absolute filename of htc file
modelpath : str
Model path relative to htc file
"""
if filename is not None:
self.modelpath = os.path.realpath(os.path.join(os.path.dirname(filename), relative_modelpath))
self.modelpath = os.path.realpath(os.path.join(os.path.dirname(filename), modelpath))
self.filename = filename
else:
self.modelpath = relative_modelpath
self.modelpath = modelpath
......
......@@ -339,9 +339,10 @@ class Simulation(object):
except:
print ("finish_simulation failed", str(self))
raise
except:
except Exception as e:
self.status = ERROR
raise
self.errors.append(str(e))
raise e
finally:
self.is_done = True
......
......@@ -51,7 +51,7 @@ class SSHClient(object):
def connect(self):
if self.password is None or self.password == "":
raise IOError("Password not set")
raise IOError("Password not set for %s"%self.host)
self.client = paramiko.SSHClient()
self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
self.client.connect(self.host, self.port, username=self.username, password=self.password, pkey=self.key, timeout=self.TIMEOUT)
......
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