# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: config.py,v 1.5 2006/11/18 18:15:37 mlhuang Exp $
-#
import os
def __init__(self, file = "/etc/planetlab/plc_config"):
try:
- execfile(file, self.__dict__)
+ exec(compile(open(file).read(), file, 'exec'), self.__dict__)
except:
- raise Exception, "Could not parse " + file
+ raise Exception("Could not parse " + file)
if int(self.PLC_API_PORT) == 443:
uri = "https://"
elif os.path.exists('/usr/boot/cacert.pem'):
self.cacert = '/usr/boot/cacert.pem'
else:
- raise Exception, "No boot server certificate bundle available"
+ raise Exception("No boot server certificate bundle available")
else:
uri = "http://"
self.cacert = None
if __name__ == '__main__':
from pprint import pprint
- pprint(Config().__dict__.items())
+ for (k, v) in Config().__dict__.items():
+ if k not in ['__builtins__']:
+ pprint ( (k, v), )