Fix bug 1987:
添加安装完成后的动作(重启/关机/待机)
修改: interface/ri_data.py
修改: interface/ri_inst_cli.py
修改: interface/ri_install.py
修改: main/setup
修改: text/ri_main.py
修改: text/ri_newt.py
Signed-off-by: sysadmin <zhihuipeng@linx-info.com>
This commit is contained in:
@@ -735,6 +735,8 @@ def init_from_xml():
|
||||
Service.init_from_xml(n)
|
||||
elif n.nodeName == 'stategrid':
|
||||
StateGrid.init_from_xml(n)
|
||||
elif n.nodeName == 'finishstate':
|
||||
FinishState.init_from_xml(n)
|
||||
|
||||
def init_from_xml_and_os():
|
||||
''' init all classes in this module from file and os '''
|
||||
@@ -767,6 +769,7 @@ def to_xml():
|
||||
Network.to_xml(xmldoc, root)
|
||||
Group.to_xml(xmldoc, root)
|
||||
Service.to_xml(xmldoc, root)
|
||||
FinishState.to_xml(xmldoc, root)
|
||||
|
||||
PrettyPrint(xmldoc, f)
|
||||
f.close()
|
||||
@@ -794,3 +797,25 @@ p_node - xml node (parent node)'''
|
||||
|
||||
p_node.appendChild(stgd)
|
||||
|
||||
class FinishState():
|
||||
''' decide reboot or shutdown or keep current status when finishing
|
||||
OS install, flag include three value: reboot, shutdown, nothing'''
|
||||
flag = ''
|
||||
|
||||
@staticmethod
|
||||
def init_from_xml(node):
|
||||
''' init finish state flag from xml node '''
|
||||
#FinishState.flag = node.firstChild.data.encode('ascii')
|
||||
for k in node.attributes.keys():
|
||||
setattr(FinishState, k, node.attributes[k].value.encode('ascii'))
|
||||
|
||||
@staticmethod
|
||||
def to_xml(doc, p_node):
|
||||
''' write reboot or not flag into xml
|
||||
doc - xml document instance
|
||||
p_node - xml node (parent node)'''
|
||||
std = doc.createElement('finishstate')
|
||||
for ft in ('flag',):
|
||||
to_xml_attr(doc, std, FinishState, ft)
|
||||
|
||||
p_node.appendChild(std)
|
||||
|
||||
Reference in New Issue
Block a user