Add auto install, HdInstall and state grid custom install

new file:   AutoInstall/auto_install.py
	new file:   StateGrid/state_grid.py
	modified:   interface/ri_data.py
	modified:   operation/exec_finish_install.sh
	new file:   operation/finish_install.py
	renamed:    operation/99finish_install.sh -> operation/finish_install/99finish_install.sh
	new file:   xml/install.xml
This commit is contained in:
Peng Zhihui
2014-02-24 10:44:53 +08:00
parent 8378d142fc
commit 21c3272eea
7 changed files with 658 additions and 52 deletions

View File

@@ -733,6 +733,8 @@ def init_from_xml():
Group.init_from_xml(n)
elif n.nodeName == 'services':
Service.init_from_xml(n)
elif n.nodeName == 'stategrid':
StateGrid.init_from_xml(n)
def init_from_xml_and_os():
''' init all classes in this module from file and os '''
@@ -768,3 +770,27 @@ def to_xml():
PrettyPrint(xmldoc, f)
f.close()
class StateGrid():
''' state grid custom install data '''
username = ''
home_dir = ''
shell = ''
@staticmethod
def init_from_xml(node):
''' init State Grid data from xml node '''
for k in node.attributes.keys():
setattr(StateGrid, k, node.attributes[k].value.encode('ascii'))
@staticmethod
def to_xml(doc, p_node):
''' write State Grid data into xml
doc - xml document instance
p_node - xml node (parent node)'''
stgd = doc.createElement('stategrid')
for st in ('username','home_dir','shell'):
to_xml_attr(doc, stgd, StateGrid, st)
p_node.appendChild(stgd)