From: Mark Huang Date: Sat, 18 Nov 2006 18:15:37 +0000 (+0000) Subject: look for PLC_API_CA_SSL_CRT (myplc), default to /usr/boot/cacert.pem (node) X-Git-Tag: planetlab-4_0-rc1~44 X-Git-Url: http://git.onelab.eu/?p=nodemanager.git;a=commitdiff_plain;h=45fe2cdaa18e28009184e95c2bed2346e2fc3eda look for PLC_API_CA_SSL_CRT (myplc), default to /usr/boot/cacert.pem (node) --- diff --git a/config.py b/config.py index 14ee71d..d5c8338 100644 --- a/config.py +++ b/config.py @@ -6,7 +6,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: config.py,v 1.3 2006/10/31 23:15:12 mlhuang Exp $ +# $Id: config.py,v 1.4 2006/10/31 23:16:16 mlhuang Exp $ # 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,7 @@ class Config: self.plc_api_uri = uri + if __name__ == '__main__': from pprint import pprint pprint(Config().__dict__.items())