uUc@sdZddlZddlmZddlmZddlmZddlmZddlmZm Z ddlm Z m Z dd lm Z m Z dd lmZdd lmZdd lmZdd lmZddlmZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#ej$dZ%ej$dZ&dZ'd Z(d!Z)d"Z*d#e+fd$YZ,dS(%s Class used to convert Solaris 10 sysidcfg to the new format used by new Solaris installer. For complete details on Solaris 10 sysidcfg keywords see Solaris 10 Installation Guide: Network-Based Installations subsection entitled "Syntax Rules for the sysidcfg File" iN(tcommon(t_(tgenerate_error(tfetch_xpath_node(t LOG_KEY_FILEtLOG_KEY_LINE_NUM(tLVL_CONVERSIONt LVL_PROCESS(tLVL_UNSUPPORTEDt LVL_WARNING(tSYSIDCFG_FILENAME(t IPAddress(tcli_wrap(tetree(tStringIOt applicationtastringtcountthostthostnamet net_addresstnet_address_v4tservicetsystemtprimaryt DefaultFixedt AutomatictNoneis\s*([^,]+)\s*,?s)\s*([^,\(]+)(\({1}([^,\)]*)\){1}){1}\s*,?s iiitXMLSysidcfgDatacBseZdZdZdZdZedZdZdZ dZ dd ddd Z d Z d Z d ZdZdZie d6ed6e d6ed6ed6ZdZdZdZdZdZdZdZdZdZdZdZd ZdLd!Zd"Z d#Z!d$Z"d%Z#d&Z$d'Z%d(Z&d)Z'd*d+d,Z(d-Z)d.Z*d/Z+d0Z,d1Z-d2e.d3Z/d4Z0d5Z1d6Z2d7Z3d8Z4d9Z5d:Z6d;Z7d<Z8d=Z9ed>Z:d?Z;i ed@6edA6edB6e9dC6e dD6e!dE6e"dF6e#dG6e$dH6e%dI6e&dJ6Z<dKZ=RS(Ms*Object used to represent the sysidcfg filecCs||_||_g|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_d|_d|_itt6dt6|_tjtt|_|jdS(sInitialize the object Arguments: sysidcfg_dict - a dictionary containing the key values pairs read in from the sysidcfg file report - the error report iN(t sysidcfg_dictt_reportt_defined_net_interfacesRt_default_networkt_keyboard_layoutt _hostnamet _name_servicet _nfs4_domaint_sys_conf_usert_service_bundlet_service_profilet_system_localet _terminalt _timeservert _timezonet_treet_svc_install_configt_svc_system_keymapt_svc_network_physicalR RRt_extra_log_paramsR tparseRtSVC_BUNDLE_XML_DEFAULTt"_XMLSysidcfgData__process_sysidcfg(tselfRtreport((sconv_sysidcfg.pyt__init__ks.                     cCst||j||jdS(sLog the specified error message at the specified level and increment the error count associated with that log level in the conversion report by 1 N(RRR0(R4tlvltmessage((sconv_sysidcfg.pyt __gen_errscCs|dkrdSxq|jD]c\}}|dksA|dkrJ|}n|d|}|jttdi|d6|d6qWdS(sCheck the payload (dict) to see if any elements are contained in it. Flag these extra elements as conversion errors Ntt=s:unrecognized option for '%(keyword)s' specified: %(value)stkeywordtvalue(Rt iteritemst_XMLSysidcfgData__gen_errRR(R4R<tpayloadtkeyR=tpstr((sconv_sysidcfg.pyt__check_payloads    cCs|jS(s-Conversion Report associated with this object(R(R4((sconv_sysidcfg.pytconversion_reportscCsi|jdk r |j|dSt|dkrC|j|dS|jddtd|d|_dS(sConverts the keyboard keyword/values from the sysidcfg into the proper xml output for the Solaris configuration file for the Automated Installer. Nis system/keymaptkeymaptlayouti(R!Rt#_XMLSysidcfgData__duplicate_keywordtlent _XMLSysidcfgData__invalid_syntaxt _XMLSysidcfgData__create_servicetTYPE_APPLICATION(R4R<tvalues((sconv_sysidcfg.pyt__convert_keyboards   cCs|jdk r7|jttdi|jd6dS|j|sk|jttdi|d6dS|j|jd|_|j|jd}|j |dt }|j |dt |dS( sConvert the hostname specified in the sysidcfg statement to the proper xml output for the Solaris configuration file for the Automated Installer. sKonly one hostname can be defined, currently it is defined as '%(hostname)s'RNs invalid hostname: '%(hostname)s'ssystem/identitytnodetconfigtnodename( R"RR?RRt#_XMLSysidcfgData__is_valid_hostnamet%_XMLSysidcfgData__create_service_nodeR&t&_XMLSysidcfgData__create_instance_nodet%_XMLSysidcfgData__create_propgrp_nodeRKt%_XMLSysidcfgData__create_propval_nodet TYPE_ASTRING(R4RtinstanceRO((sconv_sysidcfg.pyt__convert_hostnames         c Cs|dkr|jddS|jdd}|dkrL|jddS|jdd}|dkr{|jddS|jdd|j|jd|_|j|jdt}|j |dt }t j |t j}|j||td |j|d t||jd d}|dk r|j |d t}t j |d }tj|} x!| D]} |j|| qoWn|j|j|j||dS( sConvert the DNS name service specified in the sysidcfg statement to the proper xml output for Solaris configuration file for the Automated Installer. t domain_nameNt name_serverRsfiles dns mdnssnetwork/dns/clientROt nameservers name servertdomaintsearcht astring_list(Rt%_XMLSysidcfgData__missing_required_optpopt_XMLSysidcfgData__adjust_nisRRR&R#RTRKt"_XMLSysidcfgData__create_prop_nodetTYPE_NET_ADDRESSR t SubElementRtELEMENT_NET_ADDRESS_LISTt%_XMLSysidcfgData__create_address_listRRURVt COMMA_PATTERNtfindallt#_XMLSysidcfgData__create_value_nodeRSt_XMLSysidcfgData__check_payload( R4R<R@RYRZtprop_grptproptplistR]tentriestentry((sconv_sysidcfg.pyt__convert_name_service_dnssBA                  tfiless user filescCs|j|jd}|j|dt}|j|dt||j|dt||j|dt||j|dt||j||j|jd}|j|dS( s[Adjust the nswitch.conf settings for default, print, host and netgroup ssystem/name-service/switchROtdefaultRtprintertnetgroupssystem/name-service/cacheN(RRR&RTRKRURVRS(R4RrRsRRtt name_serviceRktname_service_cache((sconv_sysidcfg.pyt __adjust_nis^s         cCs,|j|jd}|j|d||S(sjAdd the xml structure for configuring the dns client with the specified enabled state snetwork/dns/clientRr(RRR&RS(R4tenabledRu((sconv_sysidcfg.pyt__configure_dns_clients  c Cs||dkr|jddS|jdd}|dkrL|jddS|jdd}|dkr{|jddS|jdddddd d d|jd d |j|jd |_|j|jdt }|j |dt ||j |dd }t j|tj}|j||td|j|j|j|jd}|j||j||dS(sConvert the NIS name service specified in the sysidcfg statement to the proper xml output for the Solaris configuration file for the Automated Installer. Currently NIS is not supported via the Automated Installer RYNRZRrs files nisRssuser files nisRttnisRRxtfalsesnetwork/nis/domainROt domainnamet ypserverss name serversnetwork/nis/client(RR_R`Rat&_XMLSysidcfgData__configure_dns_clientRRR&R#RTRKRUt TYPE_HOSTNAMERbR RdRtELEMENT_HOST_LISTRfRRSRj( R4R<R@RYRZRkR}t host_listt nis_client((sconv_sysidcfg.pyt__convert_name_service_nissB6                   cCs*|jttd|j||dS(sConvert the NIS+ name service specified in the sysidcfg statement to the proper xml output for the Solaris configuration file for the Automated Installer. NIS+ is not longer supported in Solaris 11. As such we convert all NIS+ entries to NIS s/NIS+ is no longer supported. Using NIS instead.N(R?R Rt*_XMLSysidcfgData__convert_name_service_nis(R4R<R@((sconv_sysidcfg.pyt__convert_name_service_nispluss  cCs*|dk r|j|dSt|_dS(sConvert the NONE name service specified in the sysidcfg statement to the proper xml output for the Solaris configuration file for the Automated Installer. N(RRItNAME_SERVICE_NONER#(R4R<R@((sconv_sysidcfg.pyt__convert_name_service_nones  c Cs]|dkr|jddS|jdd}|dkrL|jddS|jdd}|dkr{|jddS|jdd}|dkr|jddS|jdd}|jdd}|jddd d d d d d|jdd|j|jd}|j|dt} |j | dt ||j | dt } t j| tj} |j| ||j|dt} |dk r|j | dt ||j | dt |n|dk r|j | dt |n|j||j|jd} |j| dt}|j |dt||j| |j||dS(sConvert the LDAP name service specified in the sysidcfg statement to the proper xml output for the Solaris configuration file for the Automated Installer. RYNtprofiletprofile_servertproxy_dntproxy_passwordRrs files ldapRssusr files ldapRttldapRRxR{snetwork/ldap/clientROt server_listtcredt search_basetbind_dnt bind_passwdsnetwork/nis/domainR|(RR_R`RaR~RRR&RTRKRURVRbt TYPE_HOSTR RdRRRiRSRRj(R4R<R@RYt profile_nameRt proxy_bind_dnRt ldap_clienttconfig_prop_grpt host_propRt cred_prop_grpRzRk((sconv_sysidcfg.pyt__convert_name_service_ldapsl        4                          tNISsNIS+tDNStLDAPtNONEcCs|jdk r |j|dS|dj}t|}|dkrQd}n |d}y|j|}Wn6tk r|jtt di|dd6n$X|j |j d||||dS(sConverts the name_service keyword/values specified in the sysidcfg statement to the proper xml output for the Solaris configuration file for the Automated Installer. Niis/unsupported name service specified: %(service)sRs/network/*/install( R#RRGtupperRHtname_service_conversion_dicttKeyErrorR?RRt*_XMLSysidcfgData__remove_selected_childrenR&(R4R<RLRutlengthR@tfunction_to_call((sconv_sysidcfg.pyt__convert_name_services"         cCs\|jt|jd|x8|jD]-}|t|jt<|jtt dq'WdS(s'Configure the network interface to Nonesnetwork_interface=NONEsFinvalid network interface, NONE interface previously defined, ignoringN( t&_XMLSysidcfgData__create_net_interfacetFalseRjRtNETWORK_KEY_LINE_NUMR0RR?RR(R4R@tnetwork((sconv_sysidcfg.pyt__config_net_interface_nones   cCst}|dks$t|dkrU|jdkr<t}q@|jttdn|jdd}|jdd}|dk r|dks|dkrn|jt tdt|dkr|jt tdnt}nV|jdd|jd d|jd d|jt td |j d ||j ||rl|jttd nx8|j D]-}|t|jt<|jt tdqvWdS(sConverts the network_interface keyword/values from the sysidcfg into the appropriate equivalent Solaris xml configuration isDefaultFixed network configuration enabled. Network is unconfigured. Use the network_interface keyword properties to define the network that should be converted.tdhcpt protocol_ipv6tyessgwhen dhcp is enabled, disabling the IPv6 interface is not supported. Ignoring protocol_ipv6=no settingsyunexpected option(s) specified. If you are using the dhcp option, the only other option you can specify is protocol_ipv6.t ip_addresstnetmaskt default_routesDefaultFixed network configuration enabled. Unable to complete network configuration, replace interface PRIMARY with the actual interface you wish to configure.snetwork_interface=PRIMARYshThe PRIMARY network interface chosen by Solaris 11 may differ from the one that Solaris 10 would choose.sQinvalid network interface, PRIMARY network interface previously defined, ignoringN(RRRHR#tTrueR?R RR`RRRjRRRR0R(R4R@tnetcfgRtipv6R((sconv_sysidcfg.pyt__config_net_interface_primarys>%            cCs|jttdi|d6tjd6ttd}|jjtj ||j |jd}|j |d}|j |dt }|j|dtd d S( s#In order to use the Solaris 10 version of the network interface cards used within the sysidcfg configuration file we need to disabled the linkname policy in network/datalink-management service by changing the phys-prefix from "net" to empty string. s<In order to support the direct translation of the sysidcfg interface '%(interface)s', Oracle Solaris 11 neutral link name support will be disabled. If you wish to use neutral link names, change the interface name specified in the sysidcfg file to a 'netx' style interface name or edit the resulting %(config)s file.t interfaceROs Oracle Solaris by default uses the prefix 'net' when assigning link names. In order to use the existing interface name specified in the sysidcfg file, this feature has been disabled. If you wish to re-enable the automatic assignment of neutral link names, remove the network/datalink-management xml node below. It will also be necessary to change any configured ipv4 or ipv6 interfaces to use an Oracle Solaris neutral link name like 'net0' snetwork/datalink-managementRrslinkname-policys phys-prefixR:N(R?R RRtSC_PROFILE_FILENAMER R&tappendR tCommentRRRSRTRKRURV(R4RttexttdlmgmtRWRO((sconv_sysidcfg.pyt__disable_linkname_policyWs         c Cs|dkst|dkr"dS|jtdt|dkrHdS|jdd}|dk r|j|tdsd}qn|jdd}|dk r|j|tdsd}qn|jdd}|dk r |jdkr |j|tds d}q n|dkrA|dkrAd}n0|dk rk|dk rkt||}nd}|dkr|jt td i|d 6n|j dkr|j |j d }|j |d |_ n|j|j d t}|j|dt|d|j|dtd|dk rP|j|dt|jn|dk r|jdkr|j|dt|n|jd|dS(sConfigures the IPv4 interface for the interface specified by the user by generating the proper xml structure used by the Solaris Automated Installer iNRs ip addressRRtnones default routesunable to complete configuration of IPv4 interface for '%(interface)s', values must be specified for both ip_address and netmask.Rsnetwork/installRrtinstall_ipv4_interfacetnames/v4t address_typetstatictstatic_addresstnetwork_interface(RRHR`tPRIMARY_INTERFACEt_XMLSysidcfgData__is_valid_ipRtlowerR R?RR RRR&RSRTRKRURVtTYPE_NET_ADDRESS_V4t get_addressRj( R4RR@RRRtaddresstnetwork_installt ipv4_network((sconv_sysidcfg.pyt__config_net_physical_ipv4sZ                    cCs|jd kr<|j|jd}|j|d|_n|j|jdt}|j|dt|d|j|dtdt |dkr|j t t d d S|j td S( s`Configures the specified interface as dhcp for ipv4 and ipv6 (if specified) snetwork/installRrRRs/v4RRisyunexpected option(s) specified. If you are using the dhcp option, the only other option you can specify is protocol_ipv6.N(R RRRR&RSRTRKRURVRHR?RRRR(R4RR@RR((sconv_sysidcfg.pyt__config_net_interface_dhcps #         cCs|jd kr<|j|jd}|j|d|_n|j|jdt}|j|dt|d|j|dtd|j|dtd |j|d td d S( sConfigures the IPv6 interface for the interface specified by the user by generating the proper xml structure used by the Solaris Automated Installer snetwork/installRrtinstall_ipv6_interfaceRs/v6Rtaddrconft statelessRtstatefulN( R RRRR&RSRTRKRURV(R4RRtipv6_interface((sconv_sysidcfg.pyt__config_net_physical_ipv6s          c Cst|jdkrk|jdks3|jtkrD|jtdS|jt|jt t ddSd}t|jdkrt}xx|jD]m}|t |j t <|tjtkrt}Pn|t}|dk rt|krt}Pn|d}qW|sd}qn|jj|}|t |j t <|tj}|t}|dk r|jdd}|dk r|j|qn|dkr|j|dS|tkr|j|dS|jds|j|n|dks t|dkr|jdks(|jtkrY|jtt di|d 6|jtq|jt t d i|d 6|jtdSnu|jd d }|jd kr|j|n|jdd}|dk r|j||n|j||xM|jD]B}|t |j t <|t}|jtt di|d 6q W|jdkrr|jtn |jtdS(sConverts the network_interface keyword/values from the sysidcfg into the new xml format Solaris Jumpstart Form network_interface = ${interface} { settings } where ${interface} is the interface to configure or the word PRIMARY iNsDefaultFixed network configuration enabled. Network properties have not been defined. Use the network_interface keyword to define the network that should be converted.iRRtnetsunsupported network configuration no parameters for interface %(interface)s specified. Configuring network for auto configurationRsDefaultFixed network configuration enabled. Network configuration for interface %(interface)s is incomplete no ipv4 or ipv6 interface has been specified.RtnoRRsounsupported network interface '%(interface)s', installer currently only supports configuring a single interface(RHRR#RRRRRR?R RRR0RtNETWORK_KEY_INTERFACERRtNETWORK_KEY_PAYLOADR`t"_XMLSysidcfgData__convert_hostnamet+_XMLSysidcfgData__config_net_interface_nonet._XMLSysidcfgData__config_net_interface_primaryt startswitht)_XMLSysidcfgData__disable_linkname_policyRt*_XMLSysidcfgData__config_net_physical_ipv6t+_XMLSysidcfgData__config_net_interface_dhcpt*_XMLSysidcfgData__config_net_physical_ipv4R ( R4tindextfoundRR@RRRR((sconv_sysidcfg.pyt__config_net_interface@s                        cCs>|jdk r |j|dS|jt|df|_dS(szStore the the nfs4_domain keyword/values from the sysidcfg so it can be converted later in the process Ni(R$RRGR0R(R4R<RL((sconv_sysidcfg.pyt__store_nfs4_domains   cCs|jdkrdS|jd}|jd|jt<|jdkrJdS|rj|jttddS|j|j d}|j |d}|j |dt }|j |d t|dS( seConverts the nfs4_domain keyword/values from the sysidcfg into the new xml format NiitDYNAMICsnetwork_interface keyword resulted in the configuration of Automatic network. nfs4_domain keyword can not be configured for this network configurationsnetwork/nfs/mapidRrs nfs-propstnfsmapid_domain(R$RR0RRR?RRRRR&RSRTRKRURV(R4t auto_netcfgR=t nfs4_domainRWtgrp((sconv_sysidcfg.pyt__set_nfs4_domains        cCsFtjtd}|j||jddt}|j|dtd|j|dtd|j|dtd|j|d td |j|d td |j|d td|j|dtd|j|dtd|j|dtd|j|dtdtjdtj |dt }|j|dS(s+Add the user account xml data to the specified parent. As the necessary data can not be derived from the sysidcfg file create an example for the user that they can edit. The entire structure is added as a comment as not to introduce any security concerns. s Configures user account as follows: * User account name 'jack' * password 'jack' * GID 10 * UID 101 * root role * bash shell t user_accounttlogintjacktpasswords 9Nd/cwBcNWFZgt descriptiont default_usertshells /usr/bin/bashtgidt10tuidt101ttypetnormaltrolestroottprofilessSystem Administratortsudoerss ALL=(ALL) ALLs %st pretty_printN( R RRRRTRRKRURVttostringR(R4tparenttcommentR((sconv_sysidcfg.pyt__add_user_accounts,    cCs|jd dt}|d krF|jtjtdd}n|}|j|dtd|j|dt||j|dtd|d krtjd tj |d t }|j|n |j|d S( sAdd the root account xml data to the specified parent. If passwd is None the root account data is added as a comment to the parent and the password is defined as 'solaris'. t root_accounts, Defines 'root' role with password 'solaris's7$5$dnRfcZse$Hx4aBQ161Uvn9ZxJFKMdRiy8tCf4gMT2s2rtkFba2y4RRRRtroles %sRN( RTRRKRR RRRURVRR(R4RtpasswdRtto_useR((sconv_sysidcfg.pyt__add_root_account1s        cCsN|j|jd|_|j|jd}|j||j||dS(sAdd the config-user xml code section needed to instantiate a user with a root role. Since a direct conversion from sysidcfg to the fields needed by this structure isn't possible most of the necessary xml structures are added as comments. If the user specified root_password keyword in the sysidcfg file we can generate the root account. If not the root account is also added as a comment. ssystem/config-userRrN(RRR&R%RSt"_XMLSysidcfgData__add_user_accountt"_XMLSysidcfgData__add_root_account(R4RRW((sconv_sysidcfg.pyt__add_config_userNs   cCsX|jdk r |j|dSt|dkrC|j|dS|j|ddS(sgConverts the root_passord keyword/values from the sysidcfg into the new xml format Nii(R%RRGRHRIt!_XMLSysidcfgData__add_config_user(R4R<RL((sconv_sysidcfg.pyt__convert_root_password^s   cCsyt|dkr#|j|dS|dj}|dkrCdS|dkrh|jttdn |j|dS(sjConverts the security_policy keyword/values from the sysidcfg into the new xml format iNiRtkerberossWunsupported security policy of kerberos specified. Only a value of 'NONE' is supported.(RHRIRR?RR(R4R<RLtpolicy((sconv_sysidcfg.pyt__convert_security_policyrs    cCs|jdk r |j|dSt|dkrC|j|dS|d|_|jdkrbn5|jdkr|jttdn |j|dS(sjConverts the service_profile keyword/values from the sysidcfg into the new xml format Niit limited_nettopensthe service profile option 'open' is not available. The system will be configured with 'service_profile=limited_net'. Additional services can be enabled later in the System Configuration manifest. See aimanifest(1M) for additional information(R'RRGRHRIR?RR(R4R<RL((sconv_sysidcfg.pyt__convert_service_profiles    c Cs]|jdk r |j|dSt|dkrC|j|dSddddddd d d d d dg }|d|krd|d}||kr|jttdi|dd6|d6||d Arguments parent - the parent node to attach all value nodes to addresses - comma separated list of ip addresses type - localize name to identify the addresses as when generating error messages. Ni(RRgRhtHOST_IP_PATTERNtmatchtgroupRRi(R4Rt addressest type_labelRRot match_patternR((sconv_sysidcfg.pyt__create_address_listps  RrRcCs?tj|tj}|jtj||jtj||S(swCreate a node with a parent of 'parent' (R RdRtELEMENT_INSTANCEtsettATTRIBUTE_NAMEtATTRIBUTE_ENABLED(R4RRRRN((sconv_sysidcfg.pyt__create_instance_nodescCst|jd}|d k r.|j|n|j|jd}|j|ddd}|j|dd}|rt}nt}|j |dd ||j |d S( sCreate the network/physical:default node, and set its value based on the value of auto_netcfg. If auto_netcfg is True, the netcfg/active_ncp property of the network/physical:default service will be set to "Automatic". If auto_netcfg is not True, the netcfg/active_ncp property will be set to "DefaultFixed". s#./service[@name='network/physical']snetwork/physicalRrRRRRt active_ncpRN( RR&Rt!_XMLSysidcfgData__remove_childrenRRRSRTt AUTOMATICt DEFAULT_FIXEDRUt!_XMLSysidcfgData__set_nfs4_domain(R4RRt network_nodetnetwork_prop_grptpropval_node_value((sconv_sysidcfg.pyt__create_net_interfaces"          cCsNtj|tj}|jtj||dk rJ|jtj|n|S(spCreate a node with a parent of 'parent' N(R RdRtELEMENT_PROPERTYR,R-RtATTRIBUTE_TYPE(R4RRt prop_typeRN((sconv_sysidcfg.pyt__create_prop_nodes  cCso|dkr!tjtj}ntj|tj}|jtj||dk rk|jtj|n|S(sCreate a node with a parent of 'parent' N( RR tElementRtELEMENT_PROPERTY_GROUPRdR,R-R:(R4RRt propgrp_typeRN((sconv_sysidcfg.pyt__create_propgrp_nodes  cCsRtj|tj}|jtj||jtj||jtj||S(sCreate a node with a parent of 'parent' (R RdRtELEMENT_PROPVALR,R-R:tATTRIBUTE_VALUE(R4RRt propval_typeR=RN((sconv_sysidcfg.pyt__create_propval_nodes c Cs|j|}|dkr3|j|j|}nt|d}|dkri|j|d}d}nd||f} t|| }|dkr|j|||}n|j||t||S(sfCreate a service node entry that conforms to the following layout. If the service exists add the property group to the default instance deleting an existing property group by that name. s./instance[@name='default']Rrs'./property_group[@name='%s'][type='%s']N( t_XMLSysidcfgData__fetch_serviceRRRR&RRSRTRURV( R4t service_labelt propgrp_nameR?t prop_namet prop_valueRRWt prp_grouptxpath((sconv_sysidcfg.pyt__create_services"           t1cCsRtj|tj}|jtj||jtj||jtj||S(syCreate a node with a parent of 'parent' (R RdRtELEMENT_SERVICER,R-tATTRIBUTE_VERSIONR:(R4RRtversiont service_typeR((sconv_sysidcfg.pyt__create_service_nodes cCs,tj|tj}|jtj||S(s3Create a node with a value attribute set to 'value'(R RdRtELEMENT_VALUE_NODER,RB(R4RR=RN((sconv_sysidcfg.pyt__create_value_nodescCs%|jttdi|d6dS(s"Generate a duplicate keyword errors5invalid entry, duplicate keyword encountered: %(key)sRAN(R?RR(R4R<((sconv_sysidcfg.pyt__duplicate_keywords  cCs%|jttdi|d6dS(s$Generate a missing required op errors1invalid entry, missing required value for: %(op)stopN(R?RR(R4toperand((sconv_sysidcfg.pyt__missing_required_ops  cCsd|}t|j|S(s3Fetch the service with the specified name s#./service[@name='%s'][@version='1'](RR&(R4RRK((sconv_sysidcfg.pyt__fetch_service"s cCs%|jttdi|d6dS(s Generate an invalid syntax errors.invalid syntax for keyword '%(key)s' specifiedRAN(R?RR(R4R<((sconv_sysidcfg.pyt__invalid_syntax)s  csjt|tkrtS|jdr2|d }ntjdtjtfd|jdDS(sePerform a basic validation of the hostname Return True if valid, False otherwise t.is [^A-Z\d-]c3sW|]M}|oNt|dkoN|jd oN|jd oNj| VqdS(i?t-N(RHRtendswithR](t.0tlabel(t disallowed(sconv_sysidcfg.pys >s( RHtMAXHOSTNAMELENRR]tretcompilet IGNORECASEtalltsplit(R4R((R`sconv_sysidcfg.pyt__is_valid_hostname/s  cCsRytj|Wn:tk rM|jttdi|d6|d6tSXtS(s>Check ipaddress. If not valid flag with appropriate error msgs$invalid %(label)s specified '%(ip)s'R_tip(R tincremental_checkt ValueErrorR?RRRR(R4RR_((sconv_sysidcfg.pyt __is_valid_ipDs   cCs1|dk r-x|D]}|j|qWndS(s,Remove all children from the parent xml nodeN(Rtremove(R4Rtchild((sconv_sysidcfg.pyt__remove_childrenOs  cCs1|j|}x|D]}|j|qWdS(sLRemove the children from the parent that match the specified xpath N(RKRl(R4RRKRnRo((sconv_sysidcfg.pyt__remove_selected_childrenUs cCsX|d}t|}|dkr+d}n |d}|||f}|jj|dS(s<Store the network interface information for later processingiiN(RHRRR(R4tline_numR<RLRRR@tdata((sconv_sysidcfg.pyt__store_net_interface]s*     cCs|jS(s/Return the xml tree associated with this object(R,(R4((sconv_sysidcfg.pyttreescCs%|jttdi|d6dS(s%Generate an unsupported keyword errorsunsupported keyword: %(key)sRAN(R?RR(R4R<RL((sconv_sysidcfg.pyt__unsupported_keywords tkeyboardRuRRt root_passwordtsecurity_policytservice_profilet system_localetterminalt timeserverR!c Cst|jdks$t|jdkr@d|j_d|j_dSt|jd|_|jdkrt j t t }t j |dtdd}ttditd6|d 6nt|jj}x|D]}|j|}|dkrtn|jj}|j}|j}|dksD|dksD|dkrMtn||jt not found: %(filename)s does not conform to the expected layout of: %(layout)stfilenameRFRitsolariss5no hostname specified, setting hostname to 'solaris'.s=Oracle Solaris 11 uses roles instead of root user. An admin user with root role privileges will need to be defined in order to access the system in multi-user mode. The necessary xml structures have been added to %(file)s as a comment. Edit %(file)s to perform the necessary modifications to define the admin user.tfile(&RRRHRtconversion_errorstunsupported_itemsRR,R&R R1RR2RRRjRR tsortedtkeysRARRLRpR0Rtsysidcfg_conversion_dictRt%_XMLSysidcfgData__unsupported_keywordt&_XMLSysidcfgData__config_net_interfaceR"RR?R R%RRR( R4Rstexpected_layoutRRAt key_value_objR<R=RpR((sconv_sysidcfg.pyt__process_sysidcfgsV$             $           N(>t__name__t __module__t__doc__R6R?RjtpropertyRDt"_XMLSysidcfgData__convert_keyboardRt*_XMLSysidcfgData__convert_name_service_dnsRaR~Rt._XMLSysidcfgData__convert_name_service_nisplust+_XMLSysidcfgData__convert_name_service_nonet+_XMLSysidcfgData__convert_name_service_ldapRt&_XMLSysidcfgData__convert_name_serviceRRRRRRRt#_XMLSysidcfgData__store_nfs4_domainR4RRRRt'_XMLSysidcfgData__convert_root_passwordt)_XMLSysidcfgData__convert_security_policyt)_XMLSysidcfgData__convert_service_profilet'_XMLSysidcfgData__convert_system_localet"_XMLSysidcfgData__convert_terminalt$_XMLSysidcfgData__convert_timeservert"_XMLSysidcfgData__convert_timezoneRfRSRRbRTRURJt TYPE_SERVICERRRiRGR_RERIRQRR1Rt%_XMLSysidcfgData__store_net_interfaceRsRRR3(((sconv_sysidcfg.pyRRs "   # " m( ^     ! n / V < ( ) 1    & / F *    "  %         3  (-RRbtsolaris_install.js2aiRtsolaris_install.js2ai.commonRRRRRRRRR R t solaris_install.js2ai.ip_addressR tsolaris_installR tlxmlR RRKRVt TYPE_COUNTRRRcRRt TYPE_SYSTEMRR3R2RRaRcRgR$R2RRRtobjectR(((sconv_sysidcfg.pytsD