git://git.onelab.eu
/
nodemanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sshsh has gone, cleanup in make sync
[nodemanager.git]
/
config.py
diff --git
a/config.py
b/config.py
index
6288bf7
..
cfc35f8
100644
(file)
--- a/
config.py
+++ b/
config.py
@@
-6,8
+6,8
@@
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id$
-#
+
+import os
class Config:
"""
class Config:
"""
@@
-23,11
+23,25
@@
class Config:
if int(self.PLC_API_PORT) == 443:
uri = "https://"
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://"
else:
uri = "http://"
+ self.cacert = None
uri += self.PLC_API_HOST + \
":" + str(self.PLC_API_PORT) + \
"/" + self.PLC_API_PATH + "/"
self.plc_api_uri = uri
uri += self.PLC_API_HOST + \
":" + str(self.PLC_API_PORT) + \
"/" + self.PLC_API_PATH + "/"
self.plc_api_uri = uri
+
+
+if __name__ == '__main__':
+ from pprint import pprint
+ for (k,v) in Config().__dict__.iteritems():
+ if k not in ['__builtins__']:
+ pprint ( (k,v), )