Ignore:
Timestamp:
Feb 13, 2010 2:43:33 PM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
d87778f
Parents:
fe28bb2
Message:

Actually a missed commit.

Slightly clearer and more commented version of the previous commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/emulab_access.py

    rfe28bb2 r94a00cb  
    12391239                if s.get("name", "") == 'userconfig' \
    12401240                        and s.get('visibility',"") == 'import':
     1241
     1242                    # Collect ther server and certificate info.
    12411243                    u = s.get('server', None)
    1242                     print "url %s" % u
    12431244                    for a in s.get('fedAttr', []):
    12441245                        if a.get('attribute',"") == 'cert':
     
    12481249                        cert = None
    12491250
    1250                     if not cert:
     1251                    if cert:
     1252                        # Make a temporary certificate file for get_url.  The
     1253                        # finally clause removes it whether something goes
     1254                        # wrong (including an exception from get_url) or not.
     1255                        try:
     1256                            tfos, tn = tempfile.mkstemp(suffix=".pem")
     1257                            tf = os.fdopen(tfos, 'w')
     1258                            print >>tf, cert
     1259                            tf.close()
     1260                            get_url(u, tn, tmpdir, "userconf")
     1261                        except IOError, e:
     1262                            raise service_error(service.error.internal,
     1263                                    "Cannot create temp file for " +
     1264                                    "userconfig certificates: %s e")
     1265                        finally:
     1266                            if tn: os.remove(tn)
     1267                    else:
    12511268                        raise service_error(service_error.req,
    12521269                                "No certificate for retreiving userconfig")
    1253                     try:
    1254                         tfos, tn = tempfile.mkstemp(suffix=".pem")
    1255                         tf = os.fdopen(tfos, 'w')
    1256                         print >>tf, cert
    1257                         tf.close()
    1258                         print "tn %s" % tn
    1259                         get_url(u, tn, tmpdir, "userconf")
    1260                     except IOError, e:
    1261                         raise service_error(service.error.internal,
    1262                                 "Cannot create temp file for " +
    1263                                 "userconfig certificates: %s e")
    1264                     finally:
    1265                         if tn: os.remove(tn)
    12661270                    break
    12671271
Note: See TracChangeset for help on using the changeset viewer.