Esempio n. 1
0
m=re.compile('/pnfs')
nf=100

f=open('files','r')
urls=f.readlines()
f.close()

surls=[]
for u in urls:
    surls.append(m.sub('srm://srm.grid.sara.nl:8443/srm/managerv2?SFN=/pnfs',strip(u)))

mx=len(surls)

i=0
while i<mx:
    req={}
    mxi=min(i+nf,mx)
    s=surls[i:mxi]
    req.update({'surls':s})
    req.update({'setype':'srmv2'})
    req.update({'no_bdii_check':1})
    req.update({'srmv2_lslevels':1})
    req.update({'protocols':['gsiftp']})
    a,b,c=gfal.gfal_init(req)
    a,b,c=gfal.gfal_ls(b)
    a,b,c=gfal.gfal_get_results(b)
    for j in range(0,len(c)):
       print c[j]['surl']+" "+c[j]['locality']
    i=i+nf
    time.sleep(1)
Esempio n. 2
0
        except MemoryError, e:
            try: gfal.gfal_internal_free(gfalobj)
            except StandardError: pass
            summary = 'error initialising GFAL: %s' % str(e)
            self.printd('ERROR: %s' % summary)
            return ('UNKNOWN', summary)
        else:
            if rc != 0:
                summary = 'problem initialising GFAL: %s' % errmsg
                self.printd('ERROR: %s' % summary)
                return ('UNKNOWN', summary)

        self.print_time()
        self.printd('Listing storage url(s).')
        try:
            (rc, gfalobj, errmsg) = gfal.gfal_ls(gfalobj)
        except StandardError:
            try: gfal.gfal_internal_free(gfalobj)
            except StandardError: pass
            return ('UNKNOWN', 'problem invoking gfal_ls(): %s' % errmsg)
        else:
            self.print_time()
            if rc != 0:
                try: gfal.gfal_internal_free(gfalobj)
                except StandardError: pass
                em = probe.ErrorsMatching(self.errorDBFile, self.errorTopics)
                er = em.match(errmsg)
                summary = 'problem listing Storage Path(s).'
                if er:
                    if status != 'CRITICAL':
                        status = er[0][2]
Esempio n. 3
0
 def ls(self):
     rc, self.gfal, errmsg = gfal.gfal_ls(self.gfal)
     if rc < 0:
         raise RequestError(errmsg)