本文整理匯總了Python中grid_control.utils.process_base.LocalProcess.finish方法的典型用法代碼示例。如果您正苦於以下問題:Python LocalProcess.finish方法的具體用法?Python LocalProcess.finish怎麽用?Python LocalProcess.finish使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類grid_control.utils.process_base.LocalProcess
的用法示例。
在下文中一共展示了LocalProcess.finish方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _parseProxy
# 需要導入模塊: from grid_control.utils.process_base import LocalProcess [as 別名]
# 或者: from grid_control.utils.process_base.LocalProcess import finish [as 別名]
def _parseProxy(self, cached = True):
# Return cached results if requested
if cached and self._cache:
return self._cache
# Call voms-proxy-info and parse results
proc = LocalProcess(self._infoExec, *self._getProxyArgs())
(retCode, stdout, stderr) = proc.finish(timeout = 10)
if (retCode != 0) and not self._ignoreWarning:
msg = ('%s output:\n%s\n%s\n' % (self._infoExec, stdout, stderr)).replace('\n\n', '\n')
msg += 'If job submission is still possible, you can set [access] ignore warnings = True\n'
raise AccessTokenError(msg + '%s failed with return code %d' % (self._infoExec, retCode))
self._cache = DictFormat(':').parse(stdout)
return self._cache
示例2: _parseProxy
# 需要導入模塊: from grid_control.utils.process_base import LocalProcess [as 別名]
# 或者: from grid_control.utils.process_base.LocalProcess import finish [as 別名]
def _parseProxy(self, cached = True):
# Return cached results if requested
if cached and self._cache:
return self._cache
# Call voms-proxy-info and parse results
args = ['--all']
if self._proxyPath:
args.extend(['--file', self._proxyPath])
proc = LocalProcess(self._infoExec, *args)
(retCode, stdout, stderr) = proc.finish(timeout = 10)
if (retCode != 0) and not self._ignoreWarning:
msg = ('voms-proxy-info output:\n%s\n%s\n' % (stdout, stderr)).replace('\n\n', '\n')
msg += 'If job submission is still possible, you can set [access] ignore warnings = True\n'
raise AccessTokenError(msg + 'voms-proxy-info failed with return code %d' % retCode)
self._cache = utils.DictFormat(':').parse(stdout)
return self._cache
示例3: _parse_proxy
# 需要導入模塊: from grid_control.utils.process_base import LocalProcess [as 別名]
# 或者: from grid_control.utils.process_base.LocalProcess import finish [as 別名]
def _parse_proxy(self, cached=True):
# Return cached results if requested
if cached and self._cache:
return self._cache
# Call voms-proxy-info and parse results
proc = LocalProcess(self._proxy_info_exec, *self._get_proxy_info_arguments())
(exit_code, stdout, stderr) = proc.finish(timeout=10)
if (exit_code != 0) and not self._ignore_warning:
msg = ('%s output:\n%s\n%s\n' % (self._proxy_info_exec, stdout, stderr)).replace('\n\n', '\n')
msg += 'If job submission is still possible, you can set [access] ignore warnings = True\n'
msg += '%s failed with return code %d' % (self._proxy_info_exec, exit_code)
raise AccessTokenError(msg)
self._cache = DictFormat(':').parse(stdout)
if not self._cache:
msg = 'Unable to parse access token information:\n\t%s\n\t%s\n'
raise AccessTokenError(msg % (stdout.strip(), stderr.strip()))
return self._cache