#NEWLINE# def addservices( self , node ) : #NEWLINE# #INDENT# ' Add services and their customizations to the ServicePlan.\n        ' #NEWLINE# if ( len ( node . services ) == 0 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# defaults = self . session . services . getdefaultservices ( node . type ) #NEWLINE# if ( node . services == defaults ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# spn = self . createElement ( 'Node' ) #NEWLINE# spn . setAttribute ( 'name' , node . name ) #NEWLINE# self . sp . appendChild ( spn ) #NEWLINE# for svc in node . services : #NEWLINE# #INDENT# s = self . createElement ( 'Service' ) #NEWLINE# spn . appendChild ( s ) #NEWLINE# s . setAttribute ( 'name' , str ( svc . _name ) ) #NEWLINE# s . setAttribute ( 'startup_idx' , str ( svc . _startindex ) ) #NEWLINE# if ( svc . _starttime != '' ) : #NEWLINE# #INDENT# s . setAttribute ( 'start_time' , str ( svc . _starttime ) ) #NEWLINE# #UNINDENT# if ( not svc . _custom ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# s . setAttribute ( 'custom' , str ( svc . _custom ) ) #NEWLINE# addelementsfromlist ( self , s , svc . _dirs , 'Directory' , 'name' ) #NEWLINE# for fn in svc . _configs : #NEWLINE# #INDENT# if ( len ( fn ) == 0 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# f = self . createElement ( 'File' ) #NEWLINE# f . setAttribute ( 'name' , fn ) #NEWLINE# s . appendChild ( f ) #NEWLINE# data = self . session . services . getservicefiledata ( svc , fn ) #NEWLINE# if ( data is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# txt = self . createTextNode ( data ) #NEWLINE# f . appendChild ( txt ) #NEWLINE# #UNINDENT# addtextelementsfromlist ( self , s , svc . _startup , 'Command' , ( ( 'type' , 'start' ) , ) ) #NEWLINE# addtextelementsfromlist ( self , s , svc . _shutdown , 'Command' , ( ( 'type' , 'stop' ) , ) ) #NEWLINE# addtextelementsfromlist ( self , s , svc . _validate , 'Command' , ( ( 'type' , 'validate' ) , ) )