Ignore:
Timestamp:
Sep 8, 2009 2:46:32 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
Children:
b770aa0
Parents:
895a133
Message:

remove access temp dirs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/access.py

    r895a133 r574055e  
    12541254
    12551255    def StartSegment(self, req, fid):
    1256         def get_url(url, cf, tmpdir):
     1256        def get_url(url, cf, destdir):
    12571257            po = urlparse(url)
    12581258            fn = po.path.rpartition('/')[2]
     
    12641264                response = conn.getresponse()
    12651265
    1266                 lf = open("%s/%s" % (tmpdir, fn), "w")
     1266                lf = open("%s/%s" % (destdir, fn), "w")
    12671267                buf = response.read(4096)
    12681268                while buf:
     
    13551355                debug=self.create_debug)
    13561356        rv = starter(self, ename, proj, user, expfile, tmpdir)
     1357
     1358        self.log.debug("[StartSegment]: removing %s" % tmpdir)
     1359        # Walk up tmpdir, deleting as we go
     1360        for path, dirs, files in os.walk(tmpdir, topdown=False):
     1361            for f in files:
     1362                os.remove(os.path.join(path, f))
     1363            for d in dirs:
     1364                os.rmdir(os.path.join(path, d))
     1365        os.rmdir(tmpdir)
     1366
    13571367        if rv:
    13581368            return { 'allocID': req['allocID'] }
Note: See TracChangeset for help on using the changeset viewer.