|
1 | 1 | # -*- coding: utf-8 -*-
|
2 | 2 |
|
3 |
| -from __future__ import with_statement, print_function |
4 |
| -from __future__ import absolute_import |
5 |
| - |
6 | 3 | '''
|
7 | 4 | organization: I2BM, Neurospin, Gif-sur-Yvette, France
|
8 | 5 |
|
|
14 | 11 | import logging
|
15 | 12 | import os
|
16 | 13 | import socket
|
17 |
| -import six |
18 | 14 | import json
|
19 | 15 | import soma_workflow.constants as constants
|
20 | 16 | from soma_workflow.errors import DRMError, ExitTimeoutException
|
21 | 17 | from soma_workflow import configuration
|
22 |
| -from soma_workflow.configuration import Configuration |
23 | 18 | import tempfile
|
24 | 19 | from soma_workflow import subprocess
|
25 | 20 | import time
|
26 |
| -import distutils.spawn |
| 21 | +import shutil |
27 | 22 |
|
28 | 23 |
|
29 | 24 | class JobTemplate(object):
|
@@ -59,7 +54,7 @@ def build_pbs_script(self, script_file=None):
|
59 | 54 | f.write('#PBS -q %s\n' % self.queue)
|
60 | 55 | # if self.env:
|
61 | 56 | # var = ','.join(['"%s=%s"' % (k, v.replace('"', '\\"'))
|
62 |
| - # for k, v in six.iteritems(self.env)]) |
| 57 | + # for k, v in self.env.items()]) |
63 | 58 | # f.write('#PBS -v %s\n' % var)
|
64 | 59 | if self.nativeSpecification:
|
65 | 60 | native_spec = self.nativeSpecification
|
@@ -186,7 +181,7 @@ def out_of_container_command():
|
186 | 181 | None)
|
187 | 182 | if out_container is not None:
|
188 | 183 | return out_container # cached
|
189 |
| - if distutils.spawn.find_executable('qstat') \ |
| 184 | + if shutil.which('qstat') \ |
190 | 185 | or 'CASA_HOST_DIR' not in os.environ:
|
191 | 186 | out_container = []
|
192 | 187 | else:
|
@@ -708,7 +703,7 @@ def get_job_exit_info(self, scheduler_job_id):
|
708 | 703 |
|
709 | 704 | self.logger.info(" ==> res_status=" + repr(res_status))
|
710 | 705 | res_resourceUsage = u''
|
711 |
| - for k, v in six.iteritems(resource_usage): |
| 706 | + for k, v in resource_usage.items(): |
712 | 707 | res_resourceUsage = res_resourceUsage + \
|
713 | 708 | k + u'=' + str(v) + u' '
|
714 | 709 |
|
|
0 commit comments