Ńņ C…#Wc@sŁdZddkZddkZddkZddkZddklZddklZddk l Z ddk l Z l Z lZddklZddklZlZlZlZdd klZlZlZdd klZdd klZdd klZdd k l!Z!ddk"l#Z#da%dZ&dZ'dZ(dZ)dZ*ei+dƒa,ei+dƒZ-ei+dƒa.defd„ƒYZ/de/fd„ƒYZ0de/fd„ƒYZ1de/fd„ƒYZ2de/fd „ƒYZ3d!e/fd"„ƒYZ4d#e/fd$„ƒYZ5d%e/fd&„ƒYZ6d'e/fd(„ƒYZ7d)e/fd*„ƒYZ8d+e/fd,„ƒYZ9d-„Z:d.„Z;d/„Z<d0„Z=d1„Z>e?d2„Z@d3„ZAd4„ZBd5d6„ZCd7„ZDd8„ZEd9„ZFdS(:s Name service selection screens i’’’’N(t InstallEngine(tINSTALL_LOGGER_NAME(tSystemConfiguration(tNO_LEADING_ZEROStfind_dnst find_domain(t IPAddress(t_tSC_GROUP_NETWORKtSCI_HELPt group_check(t BaseScreent SkipExceptiont UIMessage(t EditField(t textwidth(tListItem(t ScrollWindow(t WindowAreaiiii’is^[A-Z0-9\-_]+$s^[A-Z0-9\-_]{0,63}$s^[A-Z0-9\-_]{1,63}$t NameServicecBsbeZdZdZdZd ZdZedƒZedƒZ edƒZ d d d „Z d „Z RS( s"Allow user to select name service s %siiiis*Enter either a host name or an IP address.s1An IP address must be of the form xxx.xxx.xxx.xxxs/IP address segments may not have leading zeros.cCsźtdjotitdƒantt|ƒi|ƒd|_d|_ t i ƒi |_ |i i dtdtƒd|_d|i_d|i_t|i_tƒ|i_d|i_d|i_tƒ|i_d|i_dS(Ns .sysconfigs#DEVELOPER: define intro in subclasst class_typetnot_found_is_erri(tLOGGERtNonetloggingt getLoggerRtsuperRt__init__tintrot scroll_regionRt get_instancetdoctget_descendantsRtTruetsctalt_nameservicet sc_ldap_pb_dntFalsetdnstlisttsc_dns_nameservertsc_ldap_searchbasetsc_ypcmd_broadcasttsc_nis_ypserverst sc_nis_domain(tselftmain_wint nameservicetscreen((s../nameservice.pyRMs         cCs)ti|i_d|ii|idƒS(sl paint screen with opening paragraph and blank line Returns the row (y-offset) after the blank line ii(Rt BORDER_WIDTHt center_wint border_sizet add_paragraphR(R-((s../nameservice.pyt_paint_openingss(iiN(t__name__t __module__t__doc__t HELP_FORMATt SCROLL_SIZER1tHOSTNAME_SCREEN_LENRt MSG_HOST_NAMEt MSG_IP_FMTtMSG_NO_LEADING_ZEROSRRR5(((s../nameservice.pyRAs   &t NSDNSChoosercBsZeZedƒZedefZdZedƒZd„Zd„Z d„Z d„Z RS(sDNS Name Services/%s/name_service.txts%stDNScCsZtt|ƒi|ƒtidƒtdƒ|_tƒ|i_ d|i_ t |_ dS(Nsin NSDNSChooser initsDIndicates whether or not the system should use the DNS name service.tfiles( RR?RRtdebugRRR'R"t dns_searchtsc_ns_switch_defaultR!tfirst_screen_visit(R-R.((s../nameservice.pyRs   c Cs˜ttƒo|iidjo t‚n|iƒ}tidƒtdƒtdƒg}t ddd|dt |ƒd ƒ}|i |d |_ |i |_t|d |iƒ|_xXt|ƒD]J\}}t d t|ƒd |tƒ}t|d |id |d |ƒqÅW|iiƒ|ii|iƒ|io|iidd tƒn>|iio|iidd tƒn|iid d tƒdS(s! called upon display of a screen t DefaultFixedsSelecting configuration of DNSs Configure DNSsDo not configure DNStx_locity_loctscrollable_linesitwindowttexttdata_objt force_to_topN(R RR"t sc_networkR R5RRBRRtlent win_size_ytlinest win_size_xtcolumnsRR2Rt enumerateRtINDENTRR.t do_updatetactivate_objectREtactivate_object_forceR!R&(R-RHtynlisttareatidxtyontwin_area((s../nameservice.pyt_show‹s0           cCsft|_|iidj|i_tid|iiƒ|iiot|iƒt |iƒndS(s7 called when changes submitted by user for all screens ison_change_screen DNS chosen? %sN( R%RERt active_objectR"R&RtinfoRR(R-((s../nameservice.pyt on_continue¬s    cCst|i_t|_dS(s…Set the DNS flag back to false, set first_screen_visit flag back to True, since the user may choose not to revisit the screenN(R%R"R&R!RE(R-((s../nameservice.pyton_prevøs ( R6R7Rt HEADER_TEXTR t HELP_DATAR9tUSER_CHOICE_DNSRR^RaRb(((s../nameservice.pyR?zs   ! t NSAltChoosercBsxeZedƒZedefZedƒedƒedƒgZd ddgZd„Z d„Z d„Z d„Z RS( sAlternate Name Services/%s/name_service.txtRtLDAPtNIScCs)tt|ƒi|ƒtdƒ|_dS(Ns¾From the list below, select one name service to be used by this system. If the desired name service is not listed, select None. The selected name service may be used in conjunction with DNS.(RRfRRR(R-R.((s../nameservice.pyRŹsc Csvttƒo|iidjo t‚n|iƒ}tidƒtddd|dt t i ƒdƒ}|i |d|_ |i|_t|d|iƒ|_|iti}xttt i ƒD]c\}}|d7}t|t|ƒdƒ}td||tƒ}t|d|id |d |ƒqĆW|iiƒ|ii|iƒ|iit ii|ii ƒd t!ƒd S( s! called upon display of a screen RFs Selecting alternate name serviceRGiRHRIiRJRKRLRMN("R RR"RNR R5RRBRRORftUSER_CHOICE_LISTRPRQRRRSRR2RRR:RTtminRRURR.RVRWRXt CHOICE_LISTtindexR#R!(R-RHRZtmenu_item_max_widthR[tnsnthiliteR]((s../nameservice.pyR^Ńs0           cCs„ti|ii|i_|iio¤|iid jp|iidjod|i_d|i_ qj|iidjod|i_d|i_ qj|iidjod|i_d|i_ qjn”d |i_ |iid jp|iidjod|i_n_|iidjod|i_d|i_ n0|iidjod|i_d |i_ nt i d |iiƒd S( s7 called when changes submitted by user for all screens RRAs files dnsRgs files ldapRhs files nistldaptniss'on_change_screen Name Service chosen=%sN( RfRkRR_R"R#R&RRDtsc_ns_switch_hosttsc_ns_switch_netgroupRR`(R-((s../nameservice.pyRaņs0        cCs4d|i_d|i_d|i_d|i_dS(saSet the values back to None, since the user may choose a not to configure a name service.N(RR"R#RDRsRr(R-((s../nameservice.pyRbs   N( R6R7RRcR RdRiRRkRR^RaRb(((s../nameservice.pyRfæs !  ! tNSDomaincBsKeZedƒZedefZdd„Zd„Zd„Z d„Z RS(s Domain Names/%s/domain.txtcCsJtt|ƒi|ƒtdƒ|_tdƒ|_d|_d|_dS(NsoSpecify the domain for the NIS or LDAP name server. Use the domain name's exact capitalization and punctuation.s Domain Name:t( RRtRRRttitleRt domain_fieldtdomain(R-R.R0((s../nameservice.pyR s  c Csttƒo|iidjo t‚n|iip t‚n|iƒ}ttd|i t |i ƒt dƒ}|i i|i |t ƒtd||t |i ƒt ddtdƒ}t|d|i d|idtd|iidd ƒ|_|iiƒ|i i|iƒd S( s show domain RFitscrollable_columnsRJRKtvalidatet error_winRLtsc_nis_domainnameN(R RR"RNR R#R5Rjt MAXDOMAINLENRRRRvRUR2tadd_textRRRxtincremental_validate_domainR.t error_lineRwRVRW(R-RHtcolsRZ((s../nameservice.pyR^+s"      !#  cCst|iiƒdtƒdS(Nt allow_empty(tvalidate_domainRwtget_textR%(R-((s../nameservice.pyRz@scCs|iiƒ}|i|jp!|iidjoĢ|ii o¾||_|iidjožt|ƒ}|ii p|iii|ƒ o||i_n|iio6t |ii|iiƒ}|o||i_qöqśd|ii|i_qžn|i|i_ dS(sģSet the LDAP/NIS domain. Additionally, if LDAP is chosen, set up the following: - the search base from the domain - the ldap search base - the ldap proxy bind distinguished name (DN) Rgscn=proxyagent,ou=profile,%sN( RwR„RxR"R#R)t_convert_to_ldap_domaint startswithR$t_ldap_domain_fixupR|(R-t new_domaintldapdomt fixedbase((s../nameservice.pyton_change_screenCs$    N( R6R7RRcR RdRRR^RzR‹(((s../nameservice.pyRts    t NSDNSServercBsQeZedƒZedefZdZdd„Zd„Z d„Z d„Z RS(sDNS Server Addressess/%s/dns_server.txticCsDtt|ƒi|ƒtdƒ|_tdƒ|_tƒ|_dS(Ns[Enter (or update) the IP address of the DNS server(s). At least one IP address is required.sDNS Server IP address:(RRŒRRRRvR'tdns_server_list(R-R.R0((s../nameservice.pyRrscCsttƒo|iidjo t‚n|iip t‚n|iƒ}d}d}xett i ƒD]T}|i i |i |tƒtdt|t|i ƒtdƒ}|d7}|t|iiƒjo+|ii|dj o|ii|}nd}|o |}n|djo |}nt|iƒ|jo>t|d|i d|dtd|iid d ƒ|i|t|d |id|d td |iid d ƒ|i|s:           cCsQ|ii|i_|iitiidƒjod|i_n d|i_dS(NRĖttrue( RR_R"RŠRŹRĻRlR*R(R-((s../nameservice.pyR‹ds  N( R6R7RRcR RdRĻRRR^R‹(((s../nameservice.pyRŹ.s    &tNSNISIPcBsNeZedƒZedefZdZd„Zd„Zd„Z d„Z RS(sNIS Name Server Informations /%s/nis.txticCs2tt|ƒi|ƒtƒ|_d}d}dS(Ni’’’’(RRŅRR'tnis_server_listR(R-R.R’R“((s../nameservice.pyRts c Cs#d}d}ttƒo|iidjo t‚ntid|iiƒ|iidjo t‚n|ii t i i dƒjo t‚n|ii o"tdƒ|_tdƒ|_ntdƒ|_td ƒ|_|iƒ}xŪttiƒD]Ź}|t|iiƒjo+|ii|dj o|ii|}nd }|o |}n|djo |}n|ii|i|tƒt|iƒtd }|i|}td |||ƒ}|ii|i|tƒtd |||d tid ƒ}t|iƒ|joRt |d |id|d|ii ot!nt"d|i#i$ddƒ|i|R<(t host_namet characterterr((s../nameservice.pyRµscCsl|pdSyti|ƒWnHtj o<}|dtjottiƒ‚nttiƒ‚nXdS(s[Wrap a call to convert_address and raise a UIMessage with appropriate message text Ni(RRßRąRR RR>R=(t ip_addressRć((s../nameservice.pyR•.scCsŅ|p"|odSttdƒƒ‚nx¢|idƒD]‘}t|ƒdjottdƒƒ‚n|idƒp|idƒottdƒƒ‚nti|iƒƒpttdƒƒ‚q9q9WdS( sÆ given a domain string, validate it Args: domain - network domain name allow_empty - if False, and domain is blank, failure Raises: UIMessage on failure NsThe domain cannot be blank.t.i?s0Domain labels must have less than 64 characters.t-s9Domain labels should not start or end with hyphens ('-').sInvalid domain( R RtsplitROR†tendswithtDOMAIN_LABEL_PATTERNtmatchtupper(RxR‚tlabel((s../nameservice.pyRƒ<s cCsx|iƒ}|ptSyti|ƒWnHtj o<}|dtjottiƒ‚ntti ƒ‚nXtS(s—Incrementally validate the IP Address as the user enters it Arg: edit_field - EditField object for validation Raises: UIMessage on failure i( R„R!Rtincremental_checkRąRR RR>R=(t edit_fieldRäRć((s../nameservice.pyR‘Rs cCsŠ|iƒ}|ptS|diƒoGx?|D]7}|iƒ o#|djottdƒƒ‚q0q0WtSyti|ƒWnHtj o<}|dt jott i ƒ‚ntt i ƒ‚nXtS(s‘Incrementally validate the host as the user enters it Arg: edit_field - EditField object for validation Raises: UIMessage on failure iu-.sMA host name can only contain letters, numbers, periods, and minus signs (-).( R„R!RŻRŽR RRRķRąRRR>R<(RīRįRāRć((s../nameservice.pyRÆcs  scCsa|iƒ}|pttdƒ|ƒ‚nti|iƒƒpttdƒ|ƒ‚ndS(sIncrementally validate EditField as the user enters it Args: edit_field - EditField object for validation etext - text to paste upon error Raises: UIMessage upon finding whitespace and special characters other than hyphens and underscores sThe %s cannot be blank.sInvalid character for %s.N(R„R RtNO_WHITE_NO_SPECIAL_PATTERNRźRė(RīRØRŲ((s../nameservice.pyR­|s  cCs„|iƒ}x’|idƒD]}t|ƒdjottdƒƒ‚n|idƒottdƒƒ‚nti|iƒƒpttdƒƒ‚qqWdS(s·Incrementally validate EditField as a domain as the user enters it Arg: edit_field - EditField object with domain to validate Raises: UIMessage if invalid character typed Råi?s/Domain labels must have less than 64 charactersRęs+A domain label may not begin with a hyphen.s"Invalid character for domain name.N( R„RēROR RR†t INCREMENTAL_DOMAIN_LABEL_PATTERNRźRė(RīRxRģ((s../nameservice.pyR‹s cCsAtƒ}x(|idƒD]}|id|ƒqWdi|ƒS(sŒ given a domain in dotted notation, produce an LDAP domain Arg: domain - domain to convert Returns converted for LDAP as string Råsdc=t,(R'RēR˜tjoin(RxtlabelsRģ((s../nameservice.pyR…›s  cCsK|i|ƒodS|idƒ}|o|do|dd|SdS(sõ if existing LDAP-formatted value, does not have the specified search base, replace it with the specified search base Args: old - the existing LDAP-formatted value new_search_base - the search base to replace it with s,dc=iRńN(RčRRē(toldtnew_search_basetdnsplit((s../nameservice.pyR‡¦s (GR8RRĀtreRÖtsolaris_install.engineRtsolaris_install.loggerRt!solaris_install.sysconfig.sc_specRt&solaris_install.sysconfig.network_utilRRRt!solaris_install.sysconfig.ip_utilRtsolaris_install.sysconfig.utilRRR R t&solaris_install.terminalui.base_screenR R R t%solaris_install.terminalui.edit_fieldRtsolaris_install.terminalui.i18nRt$solaris_install.terminalui.list_itemRt(solaris_install.terminalui.scroll_windowRt&solaris_install.terminalui.window_areaRRRRURR R}R°tcompileRļRšRéRR?RfRtRŒR›R”R·RæRŹRŅR“RČRÉRµR•R!RƒR‘RÆR­RR…R‡(((s../nameservice.pyts`    "9E\QYZƒ3Y@{