Esempio n. 1
0
	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
Esempio n. 2
0
 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
Esempio n. 3
0
	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
Esempio n. 4
0
	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
Esempio n. 5
0
 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
Esempio n. 6
0
 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