X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=config.py;h=98bb224af9d805534f2c42dba5d3d13b927587e8;hb=570d234b7d7b40416b296de71225f28c826ee991;hp=14ee71d0af563f575808f1eddbbd369ee4872098;hpb=08fff9819ceb2d126e43cdcfc1f20ccb85703320;p=nodemanager.git diff --git a/config.py b/config.py index 14ee71d..98bb224 100644 --- a/config.py +++ b/config.py @@ -6,8 +6,8 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: config.py,v 1.3 2006/10/31 23:15:12 mlhuang Exp $ -# + +import os class Config: """ @@ -23,8 +23,15 @@ class Config: if int(self.PLC_API_PORT) == 443: uri = "https://" + if hasattr(self, 'PLC_API_CA_SSL_CRT'): + self.cacert = self.PLC_API_CA_SSL_CRT + elif os.path.exists('/usr/boot/cacert.pem'): + self.cacert = '/usr/boot/cacert.pem' + else: + raise Exception, "No boot server certificate bundle available" else: uri = "http://" + self.cacert = None uri += self.PLC_API_HOST + \ ":" + str(self.PLC_API_PORT) + \ @@ -32,6 +39,9 @@ class Config: self.plc_api_uri = uri + if __name__ == '__main__': from pprint import pprint - pprint(Config().__dict__.items()) + for (k, v) in Config().__dict__.iteritems(): + if k not in ['__builtins__']: + pprint ( (k, v), )