From 268c8563fefd1fb6d4823d4bf4b7f8dc23faaf3f Mon Sep 17 00:00:00 2001 From: Enol Fernandez Date: Wed, 18 Jun 2014 16:26:00 +0200 Subject: [PATCH] Use valid python 2.4 syntax. --- cernvm/amiconfig/plugins/cernvm.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/cernvm/amiconfig/plugins/cernvm.py b/cernvm/amiconfig/plugins/cernvm.py index e4a8e96..f58768c 100644 --- a/cernvm/amiconfig/plugins/cernvm.py +++ b/cernvm/amiconfig/plugins/cernvm.py @@ -167,24 +167,26 @@ def configure(self): # Write configuration f = None try: - f = open('/etc/cvmfs/config.d/%s.conf'%r_name, 'w') - f.write( 'CVMFS_SERVER_URL=http://%s/cvmfs/%s\n' % (r_serv, r_name) ) - f.write( 'CVMFS_HTTP_PROXY=DIRECT\n' ) - except IOError, e: - print "Cannot write configuration for CVMFS repo %s" % r_name - pass + try: + f = open('/etc/cvmfs/config.d/%s.conf'%r_name, 'w') + f.write( 'CVMFS_SERVER_URL=http://%s/cvmfs/%s\n' % (r_serv, r_name) ) + f.write( 'CVMFS_HTTP_PROXY=DIRECT\n' ) + except IOError, e: + print "Cannot write configuration for CVMFS repo %s" % r_name + pass finally: if f is not None: f.close() # Write key f = None try: - f = open('/etc/cvmfs/keys/%s.pub'%r_name, 'w') - f.write(r_key) - f.write('\n') - except IOError, e: - print "Cannot write pubkey for CVMFS repo %s" % r_name - pass + try: + f = open('/etc/cvmfs/keys/%s.pub'%r_name, 'w') + f.write(r_key) + f.write('\n') + except IOError, e: + print "Cannot write pubkey for CVMFS repo %s" % r_name + pass finally: if f is not None: f.close()