-
Notifications
You must be signed in to change notification settings - Fork 533
FIX: TypeError bug for PBS process communication in python3 #1987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
|
||
import os | ||
from time import sleep | ||
import subprocess | ||
|
||
from ...interfaces.base import CommandLine | ||
from .base import (SGELikeBatchManagerBase, logger, iflogger, logging) | ||
|
@@ -46,13 +45,12 @@ def __init__(self, **kwargs): | |
super(PBSPlugin, self).__init__(template, **kwargs) | ||
|
||
def _is_pending(self, taskid): | ||
# subprocess.Popen requires taskid to be a string | ||
proc = subprocess.Popen(["qstat", str(taskid)], | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE) | ||
_, e = proc.communicate() | ||
result = CommandLine('qstat {}'.format(taskid), | ||
environ=dict(os.environ), | ||
terminal_output='allatonce', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
ignore_exception=True).run() | ||
errmsg = 'Unknown Job Id' # %s' % taskid | ||
return errmsg not in e | ||
return errmsg not in result.runtime.stderr | ||
|
||
def _submit_batchtask(self, scriptfile, node): | ||
cmd = CommandLine('qsub', environ=dict(os.environ), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove this line if you want to use the default environment