git://git.onelab.eu
/
myplc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Symlink any (real) files or directories in /data/var/www/html/* to
[myplc.git]
/
plc-config-tty
diff --git
a/plc-config-tty
b/plc-config-tty
index
9bb8abe
..
79f7233
100755
(executable)
--- a/
plc-config-tty
+++ b/
plc-config-tty
@@
-6,6
+6,11
@@
#
# -d is for the myplc-devel package
#
# -d is for the myplc-devel package
+# we use 3 instances of PLCConfiguration throughout:
+# cdef : models the defaults, from plc_default.xml
+# cread : merged from plc_default & configs/site.xml
+# cwrite : site.xml + pending changes
+
import sys
import os
import re
import sys
import os
import re
@@
-15,29
+20,32
@@
import getopt
from plc_config import PLCConfiguration
####################
from plc_config import PLCConfiguration
####################
-release_id = "$Id: plc-config-tty,v 1.
5 2006/08/08 16:59:23
thierry Exp $"
-release_rev = "$Revision$"
+release_id = "$Id: plc-config-tty,v 1.
10 2006/12/12 10:14:44
thierry Exp $"
+release_rev = "$Revision
: 1.10
$"
def init_flavour (flavour):
global service
def init_flavour (flavour):
global service
- global
common
_variables
+ global
usual
_variables
if (flavour == "devel"):
service="plc-devel"
if (flavour == "devel"):
service="plc-devel"
-
common
_variables=("PLC_DEVEL_FEDORA_URL",
+
usual
_variables=("PLC_DEVEL_FEDORA_URL",
"PLC_DEVEL_CVSROOT")
config_dir = "/plc/devel/data/etc/planetlab"
else:
service="plc"
"PLC_DEVEL_CVSROOT")
config_dir = "/plc/devel/data/etc/planetlab"
else:
service="plc"
- common_variables=("PLC_NAME",
- "PLC_ROOT_USER",
- "PLC_ROOT_PASSWORD",
- "PLC_MAIL_SUPPORT_ADDRESS",
- "PLC_DB_HOST",
- "PLC_API_HOST",
- "PLC_WWW_HOST",
- "PLC_BOOT_HOST",
- "PLC_NET_DNS1",
- "PLC_NET_DNS2")
+ usual_variables=("PLC_NAME",
+ "PLC_SLICE_PREFIX",
+ "PLC_ROOT_USER",
+ "PLC_ROOT_PASSWORD",
+ "PLC_MAIL_ENABLED",
+ "PLC_MAIL_SUPPORT_ADDRESS",
+ "PLC_DB_HOST",
+ "PLC_API_HOST",
+ "PLC_WWW_HOST",
+ "PLC_BOOT_HOST",
+ "PLC_NET_DNS1",
+ "PLC_NET_DNS2",
+ )
config_dir = "/etc/planetlab"
global def_default_config
def_default_config= "%s/default_config.xml" % config_dir
config_dir = "/etc/planetlab"
global def_default_config
def_default_config= "%s/default_config.xml" % config_dir
@@
-360,7
+368,7
@@
def mainloop (cdef, cread, cwrite, default_config, site_config, consolidated_con
print ("You might want to type 'r' (restart plc) or 'q' (quit)")
elif (command == "u"):
try:
print ("You might want to type 'r' (restart plc) or 'q' (quit)")
elif (command == "u"):
try:
- for varname in
common
_variables:
+ for varname in
usual
_variables:
(category,variable) = cdef.locate_varname(varname)
prompt_variable(cdef, cread, cwrite, category, variable, False)
except Exception, inst:
(category,variable) = cdef.locate_varname(varname)
prompt_variable(cdef, cread, cwrite, category, variable, False)
except Exception, inst:
@@
-376,8
+384,12
@@
def mainloop (cdef, cread, cwrite, default_config, site_config, consolidated_con
elif mode == 'CATEGORY':
prompt_variables_category(cdef,cread,cwrite,category_id,show_comments)
elif mode == 'VARIABLE':
elif mode == 'CATEGORY':
prompt_variables_category(cdef,cread,cwrite,category_id,show_comments)
elif mode == 'VARIABLE':
- prompt_variable (cdef,cread,cwrite,category,variable,
- show_comments,False)
+ try:
+ prompt_variable (cdef,cread,cwrite,category,variable,
+ show_comments,False)
+ except Exception, inst:
+ if (str(inst) != 'BailOut'):
+ raise
elif (command in "vVsSlL"):
show_value=(command in "sSlL")
(c1,c2,c3) = (cdef, cread, cwrite)
elif (command in "vVsSlL"):
show_value=(command in "sSlL")
(c1,c2,c3) = (cdef, cread, cwrite)
@@
-425,7
+437,7
@@
def main ():
if opt[0] == "-h":
usage()
if opt[0] == "-v":
if opt[0] == "-h":
usage()
if opt[0] == "-v":
- print ("This is %s - %s" %(command,release_
id
))
+ print ("This is %s - %s" %(command,release_
rev
))
sys.exit(1)
if opt[0] == "-d":
init_flavour("devel")
sys.exit(1)
if opt[0] == "-d":
init_flavour("devel")