Skip to content

Commit

Permalink
Removed some legacy exception raises
Browse files Browse the repository at this point in the history
Some old try/except were removed, these used to log a debug message or
do something before re-raising the same exception. However they are now
just redundant except-raise statements, these have been removed as the
exception will percolate up without this.
  • Loading branch information
jimboid committed Jul 5, 2017
1 parent 3dc1244 commit 1fdf068
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 49 deletions.
16 changes: 2 additions & 14 deletions longbow/corelibs/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,12 @@ def processconfigs(parameters):
"""
# Try and load the host file.
try:

_, hostsections, hostdata = loadconfigs(parameters["hosts"])

except exceptions.ConfigurationError:

raise
_, hostsections, hostdata = loadconfigs(parameters["hosts"])

# If we have been given a job file then try and load it.
if parameters["job"] is not "":

try:

_, _, jobdata = loadconfigs(parameters["job"])

except exceptions.ConfigurationError:

raise
_, _, jobdata = loadconfigs(parameters["job"])

# If there is no job file, then attempt to build a job from other sources.
else:
Expand Down
8 changes: 1 addition & 7 deletions longbow/schedulers/lsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,7 @@ def status(job):

jobstate = ""

try:

shellout = shellwrappers.sendtossh(job, ["bjobs -u " + job["user"]])

except exceptions.SSHError:

raise
shellout = shellwrappers.sendtossh(job, ["bjobs -u " + job["user"]])

# PBS will return a table, so split lines into a list.
stdout = shellout[0].split("\n")
Expand Down
8 changes: 1 addition & 7 deletions longbow/schedulers/pbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,7 @@ def status(job):

jobstate = ""

try:

shellout = shellwrappers.sendtossh(job, ["qstat -u " + job["user"]])

except exceptions.SSHError:

raise
shellout = shellwrappers.sendtossh(job, ["qstat -u " + job["user"]])

# PBS will return a table, so split lines into a list.
stdout = shellout[0].split("\n")
Expand Down
8 changes: 1 addition & 7 deletions longbow/schedulers/sge.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,7 @@ def status(job):

jobstate = ""

try:

shellout = shellwrappers.sendtossh(job, ["qstat -u " + job["user"]])

except exceptions.SSHError:

raise
shellout = shellwrappers.sendtossh(job, ["qstat -u " + job["user"]])

# PBS will return a table, so split lines into a list.
stdout = shellout[0].split("\n")
Expand Down
8 changes: 1 addition & 7 deletions longbow/schedulers/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,7 @@ def status(job):

jobstate = ""

try:

shellout = shellwrappers.sendtossh(job, ["squeue -u " + job["user"]])

except exceptions.SSHError:

raise
shellout = shellwrappers.sendtossh(job, ["squeue -u " + job["user"]])

# PBS will return a table, so split lines into a list.
stdout = shellout[0].split("\n")
Expand Down
8 changes: 1 addition & 7 deletions longbow/schedulers/soge.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,7 @@ def status(job):

jobstate = ""

try:

shellout = shellwrappers.sendtossh(job, ["qstat -u " + job["user"]])

except exceptions.SSHError:

raise
shellout = shellwrappers.sendtossh(job, ["qstat -u " + job["user"]])

# PBS will return a table, so split lines into a list.
stdout = shellout[0].split("\n")
Expand Down

0 comments on commit 1fdf068

Please sign in to comment.