<s> """<STR_LIT>""" <EOL> import itertools <EOL> import errno <EOL> from ganeti . cli import * <EOL> from ganeti import cli <EOL> from ganeti import bootstrap <EOL> from ganeti import opcodes <EOL> from ganeti import utils <EOL> from ganeti import constants <EOL> from ganeti import errors <EOL> from ganeti import netutils <EOL> from ganeti import pathutils <EOL> from ganeti import ssh <EOL> from ganeti import compat <EOL> from ganeti import confd <EOL> from ganeti . confd import client as confd_client <EOL> _LIST_DEF_FIELDS = [ <EOL> "<STR_LIT:name>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> ] <EOL> _LIST_VOL_DEF_FIELDS = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:name>" , "<STR_LIT:size>" , "<STR_LIT>" ] <EOL> _LIST_STOR_DEF_FIELDS = [ <EOL> constants . SF_NODE , <EOL> constants . SF_TYPE , <EOL> constants . SF_NAME , <EOL> constants . SF_SIZE , <EOL> constants . SF_USED , <EOL> constants . SF_FREE , <EOL> constants . SF_ALLOCATABLE , <EOL> ] <EOL> _LIST_POWER_COMMANDS = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:status>" ] <EOL> _LIST_STOR_HEADERS = { <EOL> constants . SF_NODE : "<STR_LIT>" , <EOL> constants . SF_TYPE : "<STR_LIT>" , <EOL> constants . SF_NAME : "<STR_LIT:Name>" , <EOL> constants . SF_SIZE : "<STR_LIT>" , <EOL> constants . SF_USED : "<STR_LIT>" , <EOL> constants . SF_FREE : "<STR_LIT>" , <EOL> constants . SF_ALLOCATABLE : "<STR_LIT>" , <EOL> } <EOL> _USER_STORAGE_TYPE = { <EOL> constants . ST_FILE : "<STR_LIT:file>" , <EOL> constants . ST_LVM_PV : "<STR_LIT>" , <EOL> constants . ST_LVM_VG : "<STR_LIT>" , <EOL> constants . ST_SHARED_FILE : "<STR_LIT>" , <EOL> constants . ST_GLUSTER : "<STR_LIT>" , <EOL> } <EOL> _STORAGE_TYPE_OPT = cli_option ( "<STR_LIT>" , "<STR_LIT>" , <EOL> dest = "<STR_LIT>" , <EOL> choices = _USER_STORAGE_TYPE . keys ( ) , <EOL> default = None , <EOL> metavar = "<STR_LIT>" , <EOL> help = ( "<STR_LIT>" % <EOL> utils . CommaJoin ( _USER_STORAGE_TYPE . keys ( ) ) ) ) <EOL> _REPAIRABLE_STORAGE_TYPES = [ st for st , so in constants . VALID_STORAGE_OPERATIONS . iteritems ( ) <EOL> if constants . SO_FIX_CONSISTENCY in so ] <EOL> _MODIFIABLE_STORAGE_TYPES = constants . MODIFIABLE_STORAGE_FIELDS . keys ( ) <EOL> _OOB_COMMAND_ASK = compat . UniqueFrozenset ( [ <EOL> constants . OOB_POWER_OFF , <EOL> constants . OOB_POWER_CYCLE , <EOL> ] ) <EOL> _ENV_OVERRIDE = compat . UniqueFrozenset ( [ "<STR_LIT:list>" ] ) <EOL> NONODE_SETUP_OPT = cli_option ( "<STR_LIT>" , default = True , <EOL> action = "<STR_LIT>" , dest = "<STR_LIT>" , <EOL> help = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) ) <EOL> IGNORE_STATUS_OPT = cli_option ( "<STR_LIT>" , default = False , <EOL> action = "<STR_LIT:store_true>" , dest = "<STR_LIT>" , <EOL> help = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) ) <EOL> def ConvertStorageType ( user_storage_type ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return _USER_STORAGE_TYPE [ user_storage_type ] <EOL> except KeyError : <EOL> raise errors . OpPrereqError ( "<STR_LIT>" % user_storage_type , <EOL> errors . ECODE_INVAL ) <EOL> def _TryReadFile ( path ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return utils . ReadFile ( path ) <EOL> except EnvironmentError , err : <EOL> if err . errno == errno . ENOENT : <EOL> return None <EOL> else : <EOL> raise <EOL> def _ReadSshKeys ( keyfiles , _tostderr_fn = ToStderr ) : <EOL> """<STR_LIT>""" <EOL> result = [ ] <EOL> for ( kind , ( private_file , public_file ) ) in keyfiles . items ( ) : <EOL> private_key = _TryReadFile ( private_file ) <EOL> public_key = _TryReadFile ( public_file ) <EOL> if public_key and private_key : <EOL> result . append ( ( kind , private_key , public_key ) ) <EOL> elif public_key or private_key : <EOL> _tostderr_fn ( "<STR_LIT>" <EOL> "<STR_LIT>" , kind , private_file , public_file ) <EOL> return result <EOL> def _SetupSSH ( options , cluster_name , node , ssh_port , cl ) : <EOL> """<STR_LIT>""" <EOL> candidate_filter = [ "<STR_LIT:|>" , [ "<STR_LIT:=>" , "<STR_LIT>" , "<STR_LIT:M>" ] , [ "<STR_LIT:=>" , "<STR_LIT>" , "<STR_LIT:C>" ] ] <EOL> result = cl . Query ( constants . QR_NODE , [ "<STR_LIT>" ] , candidate_filter ) <EOL> if len ( result . data ) < <NUM_LIT:1> : <EOL> raise errors . OpPrereqError ( "<STR_LIT>" ) <EOL> candidates = [ uuid for ( ( _ , uuid ) , ) in result . data ] <EOL> candidate_keys = ssh . QueryPubKeyFile ( candidates ) <EOL> if options . force_join : <EOL> ToStderr ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> host_keys = _ReadSshKeys ( constants . SSH_DAEMON_KEYFILES ) <EOL> ( _ , root_keyfiles ) = ssh . GetAllUserFiles ( constants . SSH_LOGIN_USER , mkdir = False , dircheck = False ) <EOL> dsa_root_keyfiles = dict ( ( kind , value ) for ( kind , value ) <EOL> in root_keyfiles . items ( ) <EOL> if kind == constants . SSHK_DSA ) <EOL> root_keys = _ReadSshKeys ( dsa_root_keyfiles ) <EOL> ( _ , cert_pem ) = utils . ExtractX509Certificate ( utils . ReadFile ( pathutils . NODED_CERT_FILE ) ) <EOL> ( ssh_key_type , ssh_key_bits ) = cl . QueryConfigValues ( [ "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> data = { <EOL> constants . SSHS_CLUSTER_NAME : cluster_name , <EOL> constants . SSHS_NODE_DAEMON_CERTIFICATE : cert_pem , <EOL> constants . SSHS_SSH_HOST_KEY : host_keys , <EOL> constants . SSHS_SSH_ROOT_KEY : root_keys , <EOL> constants . SSHS_SSH_AUTHORIZED_KEYS : candidate_keys , <EOL> constants . SSHS_SSH_KEY_TYPE : ssh_key_type , <EOL> constants . SSHS_SSH_KEY_BITS : ssh_key_bits , <EOL> } <EOL> ssh . RunSshCmdWithStdin ( cluster_name , node , pathutils . PREPARE_NODE_JOIN , <EOL> ssh_port , data , <EOL> debug = options . debug , verbose = options . verbose , <EOL> use_cluster_key = False , ask_key = options . ssh_key_check , <EOL> strict_host_check = options . ssh_key_check ) <EOL> ( _ , pub_keyfile ) = root_keyfiles [ ssh_key_type ] <EOL> pub_key = ssh . ReadRemoteSshPubKey ( pub_keyfile , node , cluster_name , ssh_port , <EOL> options . ssh_key_check , <EOL> options . ssh_key_check ) <EOL> ssh . AddPublicKey ( node , pub_key ) <EOL> @ UsesRPC <EOL> def AddNode ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> cl = GetClient ( ) <EOL> node = netutils . GetHostname ( name = args [ <NUM_LIT:0> ] ) . name <EOL> readd = opts . readd <EOL> ssh_port = None <EOL> try : <EOL> node_groups = [ opts . nodegroup ] if opts . nodegroup is not None else [ ] <EOL> output = cl . QueryGroups ( names = node_groups , fields = [ "<STR_LIT>" ] , <EOL> use_locking = False ) <EOL> ( ssh_port , ) = output [ <NUM_LIT:0> ] <EOL> except ( errors . OpPrereqError , errors . OpExecError ) : <EOL> pass <EOL> try : <EOL> output = cl . QueryNodes ( names = [ node ] , <EOL> fields = [ "<STR_LIT:name>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" ] , <EOL> use_locking = False ) <EOL> if len ( output ) == <NUM_LIT:0> : <EOL> node_exists = "<STR_LIT>" <EOL> sip = None <EOL> else : <EOL> node_exists , sip , is_master , ssh_port = output [ <NUM_LIT:0> ] <EOL> except ( errors . OpPrereqError , errors . OpExecError ) : <EOL> node_exists = "<STR_LIT>" <EOL> sip = None <EOL> if readd : <EOL> if not node_exists : <EOL> ToStderr ( "<STR_LIT>" <EOL> "<STR_LIT>" , node ) <EOL> return <NUM_LIT:1> <EOL> if is_master : <EOL> ToStderr ( "<STR_LIT>" , node ) <EOL> return <NUM_LIT:1> <EOL> else : <EOL> if node_exists : <EOL> ToStderr ( "<STR_LIT>" <EOL> "<STR_LIT>" , node , node_exists ) <EOL> return <NUM_LIT:1> <EOL> sip = opts . secondary_ip <EOL> ( cluster_name , ) = cl . QueryConfigValues ( [ "<STR_LIT>" ] ) <EOL> if not opts . node_setup : <EOL> ToStdout ( "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> ( modify_ssh_setup , ) = cl . QueryConfigValues ( [ "<STR_LIT>" ] ) <EOL> if modify_ssh_setup : <EOL> ToStderr ( "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" , node ) <EOL> if modify_ssh_setup : <EOL> _SetupSSH ( opts , cluster_name , node , ssh_port , cl ) <EOL> bootstrap . SetupNodeDaemon ( opts , cluster_name , node , ssh_port ) <EOL> if opts . disk_state : <EOL> disk_state = utils . FlatToDict ( opts . disk_state ) <EOL> else : <EOL> disk_state = { } <EOL> hv_state = dict ( opts . hv_state ) <EOL> op = opcodes . OpNodeAdd ( node_name = args [ <NUM_LIT:0> ] , secondary_ip = sip , <EOL> readd = opts . readd , group = opts . nodegroup , <EOL> vm_capable = opts . vm_capable , ndparams = opts . ndparams , <EOL> master_capable = opts . master_capable , <EOL> disk_state = disk_state , <EOL> hv_state = hv_state , <EOL> node_setup = modify_ssh_setup , <EOL> verbose = opts . verbose , <EOL> debug = opts . debug > <NUM_LIT:0> ) <EOL> SubmitOpCode ( op , opts = opts ) <EOL> def ListNodes ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> selected_fields = ParseFields ( opts . output , _LIST_DEF_FIELDS ) <EOL> fmtoverride = dict . fromkeys ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] , <EOL> ( "<STR_LIT:U+002C>" . join , False ) ) <EOL> cl = GetClient ( ) <EOL> return GenericList ( constants . QR_NODE , selected_fields , args , opts . units , <EOL> opts . separator , not opts . no_headers , <EOL> format_override = fmtoverride , verbose = opts . verbose , <EOL> force_filter = opts . force_filter , cl = cl ) <EOL> def ListNodeFields ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> cl = GetClient ( ) <EOL> return GenericListFields ( constants . QR_NODE , args , opts . separator , <EOL> not opts . no_headers , cl = cl ) <EOL> def EvacuateNode ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> if opts . dst_node is not None : <EOL> ToStderr ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> opts . secondary_only = True <EOL> opts . primary_only = False <EOL> if opts . secondary_only and opts . primary_only : <EOL> raise errors . OpPrereqError ( "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> errors . ECODE_INVAL ) <EOL> elif opts . primary_only : <EOL> mode = constants . NODE_EVAC_PRI <EOL> elif opts . secondary_only : <EOL> mode = constants . NODE_EVAC_SEC <EOL> else : <EOL> mode = constants . NODE_EVAC_ALL <EOL> fields = [ ] <EOL> if not opts . secondary_only : <EOL> fields . append ( "<STR_LIT>" ) <EOL> if not opts . primary_only : <EOL> fields . append ( "<STR_LIT>" ) <EOL> cl = GetClient ( ) <EOL> qcl = GetClient ( ) <EOL> result = qcl . QueryNodes ( names = args , fields = fields , use_locking = False ) <EOL> qcl . Close ( ) <EOL> instances = set ( itertools . chain ( * itertools . chain ( * itertools . chain ( result ) ) ) ) <EOL> if not instances : <EOL> ToStderr ( "<STR_LIT>" , <EOL> utils . CommaJoin ( args ) ) <EOL> return constants . EXIT_SUCCESS <EOL> if not ( opts . force or <EOL> AskUser ( "<STR_LIT>" % <EOL> ( utils . CommaJoin ( utils . NiceSort ( instances ) ) , <EOL> utils . CommaJoin ( args ) ) ) ) : <EOL> return constants . EXIT_CONFIRMATION <EOL> op = opcodes . OpNodeEvacuate ( node_name = args [ <NUM_LIT:0> ] , mode = mode , <EOL> remote_node = opts . dst_node , <EOL> iallocator = opts . iallocator , <EOL> early_release = opts . early_release , <EOL> ignore_soft_errors = opts . ignore_soft_errors ) <EOL> result = SubmitOrSend ( op , opts , cl = cl ) <EOL> jex = JobExecutor ( cl = cl , opts = opts ) <EOL> for ( status , job_id ) in result [ constants . JOB_IDS_KEY ] : <EOL> jex . AddJobId ( None , status , job_id ) <EOL> results = jex . GetResults ( ) <EOL> bad_cnt = len ( [ row for row in results if not row [ <NUM_LIT:0> ] ] ) <EOL> if bad_cnt == <NUM_LIT:0> : <EOL> ToStdout ( "<STR_LIT>" ) <EOL> rcode = constants . EXIT_SUCCESS <EOL> else : <EOL> ToStdout ( "<STR_LIT>" , bad_cnt ) <EOL> rcode = constants . EXIT_FAILURE <EOL> return rcode <EOL> def FailoverNode ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> cl = GetClient ( ) <EOL> force = opts . force <EOL> selected_fields = [ "<STR_LIT:name>" , "<STR_LIT>" ] <EOL> qcl = GetClient ( ) <EOL> result = qcl . QueryNodes ( names = args , fields = selected_fields , <EOL> use_locking = False ) <EOL> qcl . Close ( ) <EOL> node , pinst = result [ <NUM_LIT:0> ] <EOL> if not pinst : <EOL> ToStderr ( "<STR_LIT>" , node ) <EOL> return <NUM_LIT:0> <EOL> pinst = utils . NiceSort ( pinst ) <EOL> retcode = <NUM_LIT:0> <EOL> if not force and not AskUser ( "<STR_LIT>" % <EOL> ( "<STR_LIT:U+002C>" . join ( "<STR_LIT>" % name for name in pinst ) ) ) : <EOL> return <NUM_LIT:2> <EOL> jex = JobExecutor ( cl = cl , opts = opts ) <EOL> for iname in pinst : <EOL> op = opcodes . OpInstanceFailover ( instance_name = iname , <EOL> ignore_consistency = opts . ignore_consistency , <EOL> iallocator = opts . iallocator ) <EOL> jex . QueueJob ( iname , op ) <EOL> results = jex . GetResults ( ) <EOL> bad_cnt = len ( [ row for row in results if not row [ <NUM_LIT:0> ] ] ) <EOL> if bad_cnt == <NUM_LIT:0> : <EOL> ToStdout ( "<STR_LIT>" , len ( results ) ) <EOL> else : <EOL> ToStdout ( "<STR_LIT>" <EOL> "<STR_LIT>" , bad_cnt , len ( results ) ) <EOL> return retcode <EOL> def MigrateNode ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> cl = GetClient ( ) <EOL> force = opts . force <EOL> selected_fields = [ "<STR_LIT:name>" , "<STR_LIT>" ] <EOL> qcl = GetClient ( ) <EOL> result = qcl . QueryNodes ( names = args , fields = selected_fields , use_locking = False ) <EOL> qcl . Close ( ) <EOL> ( ( node , pinst ) , ) = result <EOL> if not pinst : <EOL> ToStdout ( "<STR_LIT>" % node ) <EOL> return <NUM_LIT:0> <EOL> pinst = utils . NiceSort ( pinst ) <EOL> if not ( force or <EOL> AskUser ( "<STR_LIT>" % <EOL> utils . CommaJoin ( utils . NiceSort ( pinst ) ) ) ) : <EOL> return constants . EXIT_CONFIRMATION <EOL> if not opts . live and opts . migration_mode is not None : <EOL> raise errors . OpPrereqError ( "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> errors . ECODE_INVAL ) <EOL> if not opts . live : <EOL> mode = constants . HT_MIGRATION_NONLIVE <EOL> else : <EOL> mode = opts . migration_mode <EOL> op = opcodes . OpNodeMigrate ( node_name = args [ <NUM_LIT:0> ] , mode = mode , <EOL> iallocator = opts . iallocator , <EOL> target_node = opts . dst_node , <EOL> allow_runtime_changes = opts . allow_runtime_chgs , <EOL> ignore_ipolicy = opts . ignore_ipolicy ) <EOL> result = SubmitOrSend ( op , opts , cl = cl ) <EOL> jex = JobExecutor ( cl = cl , opts = opts ) <EOL> for ( status , job_id ) in result [ constants . JOB_IDS_KEY ] : <EOL> jex . AddJobId ( None , status , job_id ) <EOL> results = jex . GetResults ( ) <EOL> bad_cnt = len ( [ row for row in results if not row [ <NUM_LIT:0> ] ] ) <EOL> if bad_cnt == <NUM_LIT:0> : <EOL> ToStdout ( "<STR_LIT>" ) <EOL> rcode = constants . EXIT_SUCCESS <EOL> else : <EOL> ToStdout ( "<STR_LIT>" , bad_cnt ) <EOL> rcode = constants . EXIT_FAILURE <EOL> return rcode <EOL> def _FormatNodeInfo ( node_info ) : <EOL> """<STR_LIT>""" <EOL> ( name , primary_ip , secondary_ip , pinst , sinst , is_mc , drained , offline , <EOL> master_capable , vm_capable , powered , ndparams , ndparams_custom ) = node_info <EOL> info = [ <EOL> ( "<STR_LIT>" , name ) , <EOL> ( "<STR_LIT>" , primary_ip ) , <EOL> ( "<STR_LIT>" , secondary_ip ) , <EOL> ( "<STR_LIT>" , is_mc ) , <EOL> ( "<STR_LIT>" , drained ) , <EOL> ( "<STR_LIT>" , offline ) , <EOL> ] <EOL> if powered is not None : <EOL> info . append ( ( "<STR_LIT>" , powered ) ) <EOL> info . extend ( [ <EOL> ( "<STR_LIT>" , master_capable ) , <EOL> ( "<STR_LIT>" , vm_capable ) , <EOL> ] ) <EOL> if vm_capable : <EOL> info . extend ( [ <EOL> ( "<STR_LIT>" , <EOL> [ iname for iname in utils . NiceSort ( pinst ) ] ) , <EOL> ( "<STR_LIT>" , <EOL> [ iname for iname in utils . NiceSort ( sinst ) ] ) , <EOL> ] ) <EOL> info . append ( ( "<STR_LIT>" , <EOL> FormatParamsDictInfo ( ndparams_custom , ndparams ) ) ) <EOL> return info <EOL> def ShowNodeConfig ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> cl = GetClient ( ) <EOL> result = cl . QueryNodes ( fields = [ "<STR_LIT:name>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" ] , <EOL> names = args , use_locking = False ) <EOL> PrintGenericInfo ( [ <EOL> _FormatNodeInfo ( node_info ) <EOL> for node_info in result <EOL> ] ) <EOL> return <NUM_LIT:0> <EOL> def RemoveNode ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> op = opcodes . OpNodeRemove ( node_name = args [ <NUM_LIT:0> ] , <EOL> debug = opts . debug > <NUM_LIT:0> , <EOL> verbose = opts . verbose ) <EOL> SubmitOpCode ( op , opts = opts ) <EOL> return <NUM_LIT:0> <EOL> def PowercycleNode ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> node = args [ <NUM_LIT:0> ] <EOL> if ( not opts . confirm and <EOL> not AskUser ( "<STR_LIT>" % node ) ) : <EOL> return <NUM_LIT:2> <EOL> op = opcodes . OpNodePowercycle ( node_name = node , force = opts . force ) <EOL> result = SubmitOrSend ( op , opts ) <EOL> if result : <EOL> ToStderr ( result ) <EOL> return <NUM_LIT:0> <EOL> def PowerNode ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> command = args . pop ( <NUM_LIT:0> ) <EOL> if opts . no_headers : <EOL> headers = None <EOL> else : <EOL> headers = { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:status>" : "<STR_LIT>" } <EOL> if command not in _LIST_POWER_COMMANDS : <EOL> ToStderr ( "<STR_LIT>" % command ) <EOL> return constants . EXIT_FAILURE <EOL> oob_command = "<STR_LIT>" % command <EOL> if oob_command in _OOB_COMMAND_ASK : <EOL> if not args : <EOL> ToStderr ( "<STR_LIT>" ) <EOL> return constants . EXIT_FAILURE <EOL> elif not opts . force and not ConfirmOperation ( args , "<STR_LIT>" , <EOL> "<STR_LIT>" % command ) : <EOL> return constants . EXIT_FAILURE <EOL> assert len ( args ) > <NUM_LIT:0> <EOL> opcodelist = [ ] <EOL> if not opts . ignore_status and oob_command == constants . OOB_POWER_OFF : <EOL> for node in args : <EOL> opcodelist . append ( opcodes . OpNodeSetParams ( node_name = node , offline = True , <EOL> auto_promote = opts . auto_promote ) ) <EOL> opcodelist . append ( opcodes . OpOobCommand ( node_names = args , <EOL> command = oob_command , <EOL> ignore_status = opts . ignore_status , <EOL> timeout = opts . oob_timeout , <EOL> power_delay = opts . power_delay ) ) <EOL> cli . SetGenericOpcodeOpts ( opcodelist , opts ) <EOL> job_id = cli . SendJob ( opcodelist ) <EOL> result = cli . PollJob ( job_id ) [ - <NUM_LIT:1> ] <EOL> errs = <NUM_LIT:0> <EOL> data = [ ] <EOL> for node_result in result : <EOL> ( node_tuple , data_tuple ) = node_result <EOL> ( _ , node_name ) = node_tuple <EOL> ( data_status , data_node ) = data_tuple <EOL> if data_status == constants . RS_NORMAL : <EOL> if oob_command == constants . OOB_POWER_STATUS : <EOL> if data_node [ constants . OOB_POWER_STATUS_POWERED ] : <EOL> text = "<STR_LIT>" <EOL> else : <EOL> text = "<STR_LIT>" <EOL> data . append ( [ node_name , text ] ) <EOL> else : <EOL> data . append ( [ node_name , "<STR_LIT>" ] ) <EOL> else : <EOL> errs += <NUM_LIT:1> <EOL> data . append ( [ node_name , cli . FormatResultError ( data_status , True ) ] ) <EOL> data = GenerateTable ( separator = opts . separator , headers = headers , <EOL> fields = [ "<STR_LIT>" , "<STR_LIT:status>" ] , data = data ) <EOL> for line in data : <EOL> ToStdout ( line ) <EOL> if errs : <EOL> return constants . EXIT_FAILURE <EOL> else : <EOL> return constants . EXIT_SUCCESS <EOL> def Health ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> op = opcodes . OpOobCommand ( node_names = args , command = constants . OOB_HEALTH , <EOL> timeout = opts . oob_timeout ) <EOL> result = SubmitOpCode ( op , opts = opts ) <EOL> if opts . no_headers : <EOL> headers = None <EOL> else : <EOL> headers = { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:status>" : "<STR_LIT>" } <EOL> errs = <NUM_LIT:0> <EOL> data = [ ] <EOL> for node_result in result : <EOL> ( node_tuple , data_tuple ) = node_result <EOL> ( _ , node_name ) = node_tuple <EOL> ( data_status , data_node ) = data_tuple <EOL> if data_status == constants . RS_NORMAL : <EOL> data . append ( [ node_name , "<STR_LIT>" % tuple ( data_node [ <NUM_LIT:0> ] ) ] ) <EOL> for item , status in data_node [ <NUM_LIT:1> : ] : <EOL> data . append ( [ "<STR_LIT>" , "<STR_LIT>" % ( item , status ) ] ) <EOL> else : <EOL> errs += <NUM_LIT:1> <EOL> data . append ( [ node_name , cli . FormatResultError ( data_status , True ) ] ) <EOL> data = GenerateTable ( separator = opts . separator , headers = headers , <EOL> fields = [ "<STR_LIT>" , "<STR_LIT:status>" ] , data = data ) <EOL> for line in data : <EOL> ToStdout ( line ) <EOL> if errs : <EOL> return constants . EXIT_FAILURE <EOL> else : <EOL> return constants . EXIT_SUCCESS <EOL> def ListVolumes ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> selected_fields = ParseFields ( opts . output , _LIST_VOL_DEF_FIELDS ) <EOL> op = opcodes . OpNodeQueryvols ( nodes = args , output_fields = selected_fields ) <EOL> output = SubmitOpCode ( op , opts = opts ) <EOL> if not opts . no_headers : <EOL> headers = { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:name>" : "<STR_LIT:Name>" , <EOL> "<STR_LIT:size>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" } <EOL> else : <EOL> headers = None <EOL> unitfields = [ "<STR_LIT:size>" ] <EOL> numfields = [ "<STR_LIT:size>" ] <EOL> data = GenerateTable ( separator = opts . separator , headers = headers , <EOL> fields = selected_fields , unitfields = unitfields , <EOL> numfields = numfields , data = output , units = opts . units ) <EOL> for line in data : <EOL> ToStdout ( line ) <EOL> return <NUM_LIT:0> <EOL> def ListStorage ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> selected_fields = ParseFields ( opts . output , _LIST_STOR_DEF_FIELDS ) <EOL> op = opcodes . OpNodeQueryStorage ( nodes = args , <EOL> storage_type = opts . user_storage_type , <EOL> output_fields = selected_fields ) <EOL> output = SubmitOpCode ( op , opts = opts ) <EOL> if not opts . no_headers : <EOL> headers = { <EOL> constants . SF_NODE : "<STR_LIT>" , <EOL> constants . SF_TYPE : "<STR_LIT>" , <EOL> constants . SF_NAME : "<STR_LIT:Name>" , <EOL> constants . SF_SIZE : "<STR_LIT>" , <EOL> constants . SF_USED : "<STR_LIT>" , <EOL> constants . SF_FREE : "<STR_LIT>" , <EOL> constants . SF_ALLOCATABLE : "<STR_LIT>" , <EOL> } <EOL> else : <EOL> headers = None <EOL> unitfields = [ constants . SF_SIZE , constants . SF_USED , constants . SF_FREE ] <EOL> numfields = [ constants . SF_SIZE , constants . SF_USED , constants . SF_FREE ] <EOL> for row in output : <EOL> for idx , field in enumerate ( selected_fields ) : <EOL> val = row [ idx ] <EOL> if field == constants . SF_ALLOCATABLE : <EOL> if val : <EOL> val = "<STR_LIT:Y>" <EOL> else : <EOL> val = "<STR_LIT:N>" <EOL> row [ idx ] = str ( val ) <EOL> data = GenerateTable ( separator = opts . separator , headers = headers , <EOL> fields = selected_fields , unitfields = unitfields , <EOL> numfields = numfields , data = output , units = opts . units ) <EOL> for line in data : <EOL> ToStdout ( line ) <EOL> return <NUM_LIT:0> <EOL> def ModifyStorage ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> ( node_name , user_storage_type , volume_name ) = args <EOL> storage_type = ConvertStorageType ( user_storage_type ) <EOL> changes = { } <EOL> if opts . allocatable is not None : <EOL> changes [ constants . SF_ALLOCATABLE ] = opts . allocatable <EOL> if changes : <EOL> op = opcodes . OpNodeModifyStorage ( node_name = node_name , <EOL> storage_type = storage_type , <EOL> name = volume_name , <EOL> changes = changes ) <EOL> SubmitOrSend ( op , opts ) <EOL> else : <EOL> ToStderr ( "<STR_LIT>" ) <EOL> def RepairStorage ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> ( node_name , user_storage_type , volume_name ) = args <EOL> storage_type = ConvertStorageType ( user_storage_type ) <EOL> op = opcodes . OpRepairNodeStorage ( node_name = node_name , <EOL> storage_type = storage_type , <EOL> name = volume_name , <EOL> ignore_consistency = opts . ignore_consistency ) <EOL> SubmitOrSend ( op , opts ) <EOL> def SetNodeParams ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> all_changes = [ opts . master_candidate , opts . drained , opts . offline , <EOL> opts . master_capable , opts . vm_capable , opts . secondary_ip , <EOL> opts . ndparams ] <EOL> if ( all_changes . count ( None ) == len ( all_changes ) and <EOL> not ( opts . hv_state or opts . disk_state ) ) : <EOL> ToStderr ( "<STR_LIT>" ) <EOL> return <NUM_LIT:1> <EOL> if opts . disk_state : <EOL> disk_state = utils . FlatToDict ( opts . disk_state ) <EOL> else : <EOL> disk_state = { } <EOL> hv_state = dict ( opts . hv_state ) <EOL> op = opcodes . OpNodeSetParams ( node_name = args [ <NUM_LIT:0> ] , <EOL> master_candidate = opts . master_candidate , <EOL> offline = opts . offline , <EOL> drained = opts . drained , <EOL> master_capable = opts . master_capable , <EOL> vm_capable = opts . vm_capable , <EOL> secondary_ip = opts . secondary_ip , <EOL> force = opts . force , <EOL> ndparams = opts . ndparams , <EOL> auto_promote = opts . auto_promote , <EOL> powered = opts . node_powered , <EOL> hv_state = hv_state , <EOL> disk_state = disk_state , <EOL> verbose = opts . verbose , <EOL> debug = opts . debug > <NUM_LIT:0> ) <EOL> result = SubmitOrSend ( op , opts ) <EOL> if result : <EOL> ToStdout ( "<STR_LIT>" , args [ <NUM_LIT:0> ] ) <EOL> for param , data in result : <EOL> ToStdout ( "<STR_LIT>" , param , data ) <EOL> return <NUM_LIT:0> <EOL> def RestrictedCommand ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> cl = GetClient ( ) <EOL> if len ( args ) > <NUM_LIT:1> or opts . nodegroup : <EOL> nodes = GetOnlineNodes ( nodes = args [ <NUM_LIT:1> : ] , cl = cl , nodegroup = opts . nodegroup ) <EOL> else : <EOL> raise errors . OpPrereqError ( "<STR_LIT>" , <EOL> errors . ECODE_INVAL ) <EOL> op = opcodes . OpRestrictedCommand ( command = args [ <NUM_LIT:0> ] , nodes = nodes , <EOL> use_locking = opts . do_locking ) <EOL> result = SubmitOrSend ( op , opts , cl = cl ) <EOL> exit_code = constants . EXIT_SUCCESS <EOL> for ( node , ( status , text ) ) in zip ( nodes , result ) : <EOL> ToStdout ( "<STR_LIT>" ) <EOL> if status : <EOL> if opts . show_machine_names : <EOL> for line in text . splitlines ( ) : <EOL> ToStdout ( "<STR_LIT>" , node , line ) <EOL> else : <EOL> ToStdout ( "<STR_LIT>" , node ) <EOL> ToStdout ( text ) <EOL> else : <EOL> exit_code = constants . EXIT_FAILURE <EOL> ToStdout ( text ) <EOL> return exit_code <EOL> def RepairCommand ( opts , args ) : <EOL> cl = GetClient ( ) <EOL> if opts . input : <EOL> inp = opts . input . decode ( '<STR_LIT>' ) <EOL> else : <EOL> inp = None <EOL> op = opcodes . OpRepairCommand ( command = args [ <NUM_LIT:0> ] , node_name = args [ <NUM_LIT:1> ] , <EOL> input = inp ) <EOL> result = SubmitOrSend ( op , opts , cl = cl ) <EOL> print result <EOL> return constants . EXIT_SUCCESS <EOL> class ReplyStatus ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . failure = True <EOL> self . answer = False <EOL> def ListDrbd ( opts , args ) : <EOL> """<STR_LIT>""" <EOL> if len ( args ) != <NUM_LIT:1> : <EOL> ToStderr ( "<STR_LIT>" ) <EOL> return constants . EXIT_FAILURE <EOL> status = ReplyStatus ( ) <EOL> def ListDrbdConfdCallback ( reply ) : <EOL> """<STR_LIT>""" <EOL> if reply . type == confd_client . UPCALL_REPLY : <EOL> answer = reply . server_reply . answer <EOL> reqtype = reply . orig_request . type <EOL> if reqtype == constants . CONFD_REQ_NODE_DRBD : <EOL> if reply . server_reply . status != constants . CONFD_REPL_STATUS_OK : <EOL> ToStderr ( "<STR_LIT>" % <EOL> ( reply . server_reply . status , <EOL> reply . server_reply . answer ) ) <EOL> status . failure = True <EOL> return <EOL> if not confd . HTNodeDrbd ( answer ) : <EOL> ToStderr ( "<STR_LIT>" , <EOL> confd . HTNodeDrbd , answer ) <EOL> status . failure = True <EOL> else : <EOL> status . failure = False <EOL> status . answer = answer <EOL> else : <EOL> ToStderr ( "<STR_LIT>" , reqtype ) <EOL> status . failure = True <EOL> node = args [ <NUM_LIT:0> ] <EOL> hmac = utils . ReadFile ( pathutils . CONFD_HMAC_KEY ) <EOL> filter_callback = confd_client . ConfdFilterCallback ( ListDrbdConfdCallback ) <EOL> counting_callback = confd_client . ConfdCountingCallback ( filter_callback ) <EOL> cf_client = confd_client . ConfdClient ( hmac , [ constants . IP4_ADDRESS_LOCALHOST ] , <EOL> counting_callback ) <EOL> req = confd_client . ConfdClientRequest ( type = constants . CONFD_REQ_NODE_DRBD , <EOL> query = node ) <EOL> def DoConfdRequestReply ( req ) : <EOL> counting_callback . RegisterQuery ( req . rsalt ) <EOL> cf_client . SendRequest ( req , async = False ) <EOL> while not counting_callback . AllAnswered ( ) : <EOL> if not cf_client . ReceiveReply ( ) : <EOL> ToStderr ( "<STR_LIT>" ) <EOL> break <EOL> DoConfdRequestReply ( req ) <EOL> if status . failure : <EOL> return constants . EXIT_FAILURE <EOL> fields = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> if opts . no_headers : <EOL> headers = None <EOL> else : <EOL> headers = { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" } <EOL> data = GenerateTable ( separator = opts . separator , headers = headers , <EOL> fields = fields , data = sorted ( status . answer ) , <EOL> numfields = [ "<STR_LIT>" ] ) <EOL> for line in data : <EOL> ToStdout ( line ) <EOL> return constants . EXIT_SUCCESS <EOL> commands = { <EOL> "<STR_LIT>" : ( <EOL> AddNode , [ ArgHost ( min = <NUM_LIT:1> , max = <NUM_LIT:1> ) ] , <EOL> [ SECONDARY_IP_OPT , READD_OPT , NOSSH_KEYCHECK_OPT , NODE_FORCE_JOIN_OPT , <EOL> NONODE_SETUP_OPT , VERBOSE_OPT , NODEGROUP_OPT , PRIORITY_OPT , <EOL> CAPAB_MASTER_OPT , CAPAB_VM_OPT , NODE_PARAMS_OPT , HV_STATE_OPT , <EOL> DISK_STATE_OPT ] , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> EvacuateNode , ARGS_ONE_NODE , <EOL> [ FORCE_OPT , IALLOCATOR_OPT , IGNORE_SOFT_ERRORS_OPT , NEW_SECONDARY_OPT , <EOL> EARLY_RELEASE_OPT , PRIORITY_OPT , PRIMARY_ONLY_OPT , SECONDARY_ONLY_OPT ] <EOL> + SUBMIT_OPTS , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> FailoverNode , ARGS_ONE_NODE , [ FORCE_OPT , IGNORE_CONSIST_OPT , <EOL> IALLOCATOR_OPT , PRIORITY_OPT ] , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> MigrateNode , ARGS_ONE_NODE , <EOL> [ FORCE_OPT , NONLIVE_OPT , MIGRATION_MODE_OPT , DST_NODE_OPT , <EOL> IALLOCATOR_OPT , PRIORITY_OPT , IGNORE_IPOLICY_OPT , <EOL> NORUNTIME_CHGS_OPT ] + SUBMIT_OPTS , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) , <EOL> "<STR_LIT:info>" : ( <EOL> ShowNodeConfig , ARGS_MANY_NODES , [ ] , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT:list>" : ( <EOL> ListNodes , ARGS_MANY_NODES , <EOL> [ NOHDR_OPT , SEP_OPT , USEUNITS_OPT , FIELDS_OPT , VERBOSE_OPT , <EOL> FORCE_FILTER_OPT ] , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" % <EOL> utils . CommaJoin ( _LIST_DEF_FIELDS ) ) , <EOL> "<STR_LIT>" : ( <EOL> ListNodeFields , [ ArgUnknown ( ) ] , <EOL> [ NOHDR_OPT , SEP_OPT ] , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> SetNodeParams , ARGS_ONE_NODE , <EOL> [ FORCE_OPT ] + SUBMIT_OPTS + <EOL> [ MC_OPT , DRAINED_OPT , OFFLINE_OPT , <EOL> CAPAB_MASTER_OPT , CAPAB_VM_OPT , SECONDARY_IP_OPT , <EOL> AUTO_PROMOTE_OPT , DRY_RUN_OPT , PRIORITY_OPT , NODE_PARAMS_OPT , <EOL> NODE_POWERED_OPT , HV_STATE_OPT , DISK_STATE_OPT , VERBOSE_OPT ] , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> PowercycleNode , ARGS_ONE_NODE , <EOL> [ FORCE_OPT , CONFIRM_OPT , DRY_RUN_OPT , PRIORITY_OPT ] + SUBMIT_OPTS , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> PowerNode , <EOL> [ ArgChoice ( min = <NUM_LIT:1> , max = <NUM_LIT:1> , choices = _LIST_POWER_COMMANDS ) , <EOL> ArgNode ( ) ] , <EOL> SUBMIT_OPTS + <EOL> [ AUTO_PROMOTE_OPT , PRIORITY_OPT , <EOL> IGNORE_STATUS_OPT , FORCE_OPT , NOHDR_OPT , SEP_OPT , OOB_TIMEOUT_OPT , <EOL> POWER_DELAY_OPT ] , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> RemoveNode , ARGS_ONE_NODE , [ DRY_RUN_OPT , PRIORITY_OPT , VERBOSE_OPT ] , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> ListVolumes , [ ArgNode ( ) ] , <EOL> [ NOHDR_OPT , SEP_OPT , USEUNITS_OPT , FIELDS_OPT , PRIORITY_OPT ] , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> ListStorage , ARGS_MANY_NODES , <EOL> [ NOHDR_OPT , SEP_OPT , USEUNITS_OPT , FIELDS_OPT , _STORAGE_TYPE_OPT , <EOL> PRIORITY_OPT ] , <EOL> "<STR_LIT>" , "<STR_LIT>" <EOL> "<STR_LIT>" % <EOL> ( utils . CommaJoin ( _LIST_STOR_HEADERS ) ) ) , <EOL> "<STR_LIT>" : ( <EOL> ModifyStorage , <EOL> [ ArgNode ( min = <NUM_LIT:1> , max = <NUM_LIT:1> ) , <EOL> ArgChoice ( min = <NUM_LIT:1> , max = <NUM_LIT:1> , choices = _MODIFIABLE_STORAGE_TYPES ) , <EOL> ArgFile ( min = <NUM_LIT:1> , max = <NUM_LIT:1> ) ] , <EOL> [ ALLOCATABLE_OPT , DRY_RUN_OPT , PRIORITY_OPT ] + SUBMIT_OPTS , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> RepairStorage , <EOL> [ ArgNode ( min = <NUM_LIT:1> , max = <NUM_LIT:1> ) , <EOL> ArgChoice ( min = <NUM_LIT:1> , max = <NUM_LIT:1> , choices = _REPAIRABLE_STORAGE_TYPES ) , <EOL> ArgFile ( min = <NUM_LIT:1> , max = <NUM_LIT:1> ) ] , <EOL> [ IGNORE_CONSIST_OPT , DRY_RUN_OPT , PRIORITY_OPT ] + SUBMIT_OPTS , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> ListTags , ARGS_ONE_NODE , [ ] , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> AddTags , [ ArgNode ( min = <NUM_LIT:1> , max = <NUM_LIT:1> ) , ArgUnknown ( ) ] , <EOL> [ TAG_SRC_OPT , PRIORITY_OPT ] + SUBMIT_OPTS , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> RemoveTags , [ ArgNode ( min = <NUM_LIT:1> , max = <NUM_LIT:1> ) , ArgUnknown ( ) ] , <EOL> [ TAG_SRC_OPT , PRIORITY_OPT ] + SUBMIT_OPTS , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> Health , ARGS_MANY_NODES , <EOL> [ NOHDR_OPT , SEP_OPT , PRIORITY_OPT , OOB_TIMEOUT_OPT ] , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> ListDrbd , ARGS_ONE_NODE , <EOL> [ NOHDR_OPT , SEP_OPT ] , <EOL> "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> RestrictedCommand , [ ArgUnknown ( min = <NUM_LIT:1> , max = <NUM_LIT:1> ) ] + ARGS_MANY_NODES , <EOL> [ SYNC_OPT , PRIORITY_OPT ] + SUBMIT_OPTS + [ SHOW_MACHINE_OPT , NODEGROUP_OPT ] , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) , <EOL> "<STR_LIT>" : ( <EOL> RepairCommand , [ ArgUnknown ( min = <NUM_LIT:1> , max = <NUM_LIT:1> ) , ArgNode ( min = <NUM_LIT:1> , max = <NUM_LIT:1> ) ] , <EOL> [ SUBMIT_OPT , INPUT_OPT ] , "<STR_LIT>" , <EOL> "<STR_LIT>" ) , <EOL> } <EOL> aliases = { <EOL> "<STR_LIT>" : "<STR_LIT:info>" , <EOL> } <EOL> def Main ( ) : <EOL> return GenericMain ( commands , aliases = aliases , <EOL> override = { "<STR_LIT>" : constants . TAG_NODE } , <EOL> env_override = _ENV_OVERRIDE ) </s>
