Created
April 26, 2013 09:44
-
-
Save ptrlv/5466129 to your computer and use it in GitHub Desktop.
parse queues.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import io | |
import requests | |
from ConfigParser import SafeConfigParser | |
#from ConfigParser import SafeConfigParser, NoSectionError, InterpolationMissingOptionError | |
url = 'http://gridui18.usatlas.bnl.gov:25880/queues.conf' | |
r = requests.get(url) | |
print 'OK:',r.ok | |
data = io.StringIO(r.text) | |
config = SafeConfigParser() | |
config.readfp(data) | |
print config.get('AGLT2_MCORE','batchsubmit.condorgt5.gridresource') | |
#print config.sections() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment