X-Git-Url: http://git.onelab.eu/?p=nodemanager.git;a=blobdiff_plain;f=config.py;h=700b2db2e0dbea4ff5bcd555924242bcc3bc4e09;hp=cfc35f83e088313fe4e04d1ddd4059b47547a97c;hb=HEAD;hpb=3f01a8df5899602098c79b61b46ff54b48b1ae75 diff --git a/config.py b/config.py index cfc35f8..700b2db 100644 --- a/config.py +++ b/config.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # Parses the PLC configuration file /etc/planetlab/plc_config, which # is bootstrapped by Boot Manager, but managed by us. @@ -17,9 +17,9 @@ class Config: 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://" @@ -28,7 +28,7 @@ class Config: 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 @@ -42,6 +42,6 @@ class Config: if __name__ == '__main__': from pprint import pprint - for (k,v) in Config().__dict__.iteritems(): + for (k, v) in Config().__dict__.items(): if k not in ['__builtins__']: - pprint ( (k,v), ) + pprint ( (k, v), )