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
reguire gnupg1 on f>=31; sense the system to use gpg1 when installed
[nodemanager.git]
/
config.py
diff --git
a/config.py
b/config.py
index
9efdecc
..
700b2db
100644
(file)
--- a/
config.py
+++ b/
config.py
@@
-1,7
+1,4
@@
-#!/usr/bin/python
-#
-# $Id$
-# $URL$
+#!/usr/bin/python3
#
# Parses the PLC configuration file /etc/planetlab/plc_config, which
# is bootstrapped by Boot Manager, but managed by us.
#
# Parses the PLC configuration file /etc/planetlab/plc_config, which
# is bootstrapped by Boot Manager, but managed by us.
@@
-9,8
+6,6
@@
# 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
import os
@@
-22,9
+17,9
@@
class Config:
def __init__(self, file = "/etc/planetlab/plc_config"):
try:
def __init__(self, file = "/etc/planetlab/plc_config"):
try:
- exec
file(file
, self.__dict__)
+ exec
(compile(open(file).read(), file, 'exec')
, self.__dict__)
except:
except:
- raise Exception
, "Could not parse " + file
+ raise Exception
("Could not parse " + file)
if int(self.PLC_API_PORT) == 443:
uri = "https://"
if int(self.PLC_API_PORT) == 443:
uri = "https://"
@@
-33,7
+28,7
@@
class Config:
elif os.path.exists('/usr/boot/cacert.pem'):
self.cacert = '/usr/boot/cacert.pem'
else:
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
else:
uri = "http://"
self.cacert = None
@@
-47,6
+42,6
@@
class Config:
if __name__ == '__main__':
from pprint import pprint
if __name__ == '__main__':
from pprint import pprint
- for (k,
v) in Config().__dict__.iter
items():
+ for (k,
v) in Config().__dict__.
items():
if k not in ['__builtins__']:
if k not in ['__builtins__']:
- pprint ( (k,v), )
+ pprint ( (k,
v), )