Ñò +z2Wc @s]ddkZddklZlZddklZddklZddk l Z l Z l Z l Z lZlZlZlZlZlZlZlZlZlZlZlZlZlZlZlZlZddkl Z l!Z!ddk"l#Z#l$Z$de#fd „ƒYZ%d e&fd „ƒYZ'd e%fd „ƒYZ(e)a*e ƒa+e)d„Z,dZ-dS(iÿÿÿÿN(t NCDeviceListt NCIPsecList(t ConfDevices(tProfile(t_tlogtSYSCONFNETWORKtgetRoottupdateNetworkScriptstSYSCONFPROFILEDIRtOLDSYSCONFDEVICEDIRt RESOLVCONFt HOSTSCONFt TestErrortSYSCONFDEVICEDIRtmkdirt issamefiletunlinktlinktrenametrmdirt getTestEnvtgeneric_error_dialogtgeneric_yesno_dialogt RESPONSE_YES(t ConfShellVart ConfEResolv(tGdtlisttgdtlist_propertiestProfileList_basecBseZeeƒRS((t__name__t __module__RR(((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR#st MyFileListcBs#eZd„Zd„Zd„ZRS(cCsKtii|ƒ}tiddt|ƒt|ƒfƒti|||ƒS(Nis$MyFileList.__setitem__(self, %s, %s)(tostpathtabspathRtstrtlistt __setitem__(tselftkeytvalue((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR&'scCsZtii|ƒ}ti|tii|ƒƒ}tiddt|ƒt|ƒfƒ|S(Nis'MyFileList.__contains__(self, %s) == %s(R!R"R#R%t __contains__RR$(R'tobjtret((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR*-s  cCsHtii|ƒ}tiddt|ƒƒti|tii|ƒƒS(NisMyFileList.append(self, %s)(R!R"R#RR$R%tappend(R'R+((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR-4s(RRR&R*R-(((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR &s  t ProfileListcBs€eZd„Zd„Zd„Zd„Zd„Zd„Zed„Z ed„Z e d„Z d „Z ed „Zd „ZRS( cCs tt|ƒiƒd|_dS(N(tsuperR.t__init__tNoneterror(R'((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR0:scCs¶d|_titƒtƒ}|idƒo|d|_n|idƒo|d|_n d|_|idjp|idjo d|_ntƒ|idt |ƒƒg}t i i tƒt ƒo…t itƒt ƒ}|oTxa|D]E}tƒt d|}t i i |ƒpqøn|i||ƒqøWqi|iddƒn|iddƒ|iƒ}tidd t|ƒƒ|i|i_|iƒ|iƒdS( NtdefaulttCURRENT_PROFILEtHOSTNAMEt localhosttit/isActiveProfile: %s(t curr_profRRRthas_keyt use_hostnameR1Rt __delslice__tlenR!R"tisdirR tlistdirtloadproftgetActiveProfileRR$tDNStHostnametcommitt setunmodified(R'tnwconftproflisttprtprofdirtprof((s</usr/share/system-config-network/netconfpkg/NCProfileList.pytload>s8      c Cs|tiƒ}tiƒ}tƒ}|i|ƒ||_||ijo t|_ n t |_ g}|ot |ƒ}n|pt t ƒt ƒ}nxD|D]<}x3|D]+}|i|jo|ii|ƒPq¬q¬WqŸWxD|D]<} x3|D]+}|i| jo|ii| ƒPqóqóWqæW|oCy|iid|dƒWq«tj o} | i|_q«Xn<y|iidtƒWn!tj o} | i|_nXtiƒ} |o|d| _nt ƒt| _| iƒ|i|i_d|i_d|i_ d|i_!d|i_"|ot#i#|dƒ} nt#i#t ƒt$ƒ} | ddjo| d|i_nt%| dƒdjo| dd|i_n| i&d ƒov| d d|i_ t%| d ƒd jo| d d |i_!nt%| d ƒd jo| d d |i_"q6n|ii'} | i&d ƒo&x#| d D]}| i|ƒq]WndS( Ntfilenames/hostss /resolv.confR7s/networkR5tdomainit nameserversiitsearch((Rt getDeviceListRt getIPsecListRR-t ProfileNameR9tTruetActivetFalseRRR tDeviceIdt ActiveDevicestIPsecIdt ActiveIPsecst HostsListRKt ValueErrortmessageR2R RRLR treadR;RBRCt Domainnamet PrimaryDNSt SecondaryDNSt TertiaryDNSRRR=R:t SearchList(R'RHRIt devicelistt ipseclistRJtdevlisttdevtdtipsectetdnsconfRFtsltns((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR@fs€                 c Cs~d}xe|D]]}y|iiƒWq tj o7}|pd|i|if}qj||i7}q Xq W|ot|ƒ‚nh}tiƒ}xà|D]Ø}|ipqžnx½|i D]²}x,|D]!}|i |jo |}PqÌqÌWq¿|i |i ƒo]|i ||i i joCtdƒtdƒ|i |i ||i i f} t| ƒ‚n|||i |ƒd$jo|d%djp |d&joqÔ ntƒt6d|}|| joqÔ nyÙti?|ƒ}|d'd joµti=tƒt$ƒ}xœ|D]}tƒt$d|}ti"i#|ƒpq• nti=|ƒ}xI|D]A}ti?|d|ƒ}ti"i@||ƒot2|ƒqà qà Wq• WnWqÔ tAj o1} tBtd(ƒh|d)6tC| ƒd*6ƒqÔ XqÔ Wti=tƒt$ƒ}!x°|!D]¨} ti=tƒt$| ƒ}xY|D]Q}tƒt$| d|}|| jotid$d+|ƒq¶ nt2|ƒq¶ Wtƒt$| }|| jotD|ƒq q W|iƒ|iEƒdS(-Niÿÿÿÿiis¯You changed the hostname. Should the hostname be set to the system now? This may have the effect, that some X applications do not function properly. You may have to relogin.s hostname %sischange hostname to %ss 127.0.0.1t.s::1slocalhost.localdomainR6iR5R3R4R8s/networks /resolv.confR7RMRORNs/hostsRLsifcfg-sroute-skeys-s.routes.baki¤t-tifcfgtroutetkeysiiúÿÿÿsifcfg-lois)Error removing file %(file)s: %(errormsg)tfileterrormsgs%s not removed(RwRxskeys(FtsocketR!tumaskRDRRRRRARt gethostnameRBRCtgetuidRRRtsystemRt gethostbynameR2R;tfindtsplitRZtIPt AliasListR-tindextcreateAliasListt gethostbyaddrtextendRRtwriteR"R>R RR RLR^RbR_R`RatsaveRWRtisfileRRRRTRUR RYR R titemsRtchmodR?R=tstattsamestattOSErrorRR$RRE("R'R|RFRjtact_proftretvaltnewipthostt newhostnametidxthnamet files_usedRJRNRLRqtprefixt devfilenamet profilenametmfiletcfilethostfiletconffileReRfRtdirlisttmdirtdirnametfilelisttfile2tstat2RiRG((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR‹ sª        "         (                $  $     $             %   cCsŽtƒ}x~|D]v}|i|joqn|o(||ijo|ii|ƒq†q||ijo|i|ii|ƒ=qqWdS(N(tgetProfileListRRRWR-R†(R'tdeviceidtprofiletstatet profilelistRJ((s</usr/share/system-config-network/netconfpkg/NCProfileList.pytactivateDevice=s cCsŽtƒ}x~|D]v}|i|joqn|o(||ijo|ii|ƒq†q||ijo|i|ii|ƒ=qqWdS(N(R§RRRYR-R†(R'tipsecidR©RªR«RJ((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyt activateIpsecJs cCsãd}xT|D]H}t|tƒo|i|jpt|tƒo||joPq q WdS|iƒ}xs|D]k}|iƒ}t|tƒo|i|jpt|tƒo ||jot|_|}qpt|_qpW|S(N( R1t isinstanceR$RRRtmodifiedRSRTRU(R'tvaltdochangetaprofRJtmodltmod((s</usr/share/system-config-network/netconfpkg/NCProfileList.pytswitchToProfileWs"        cCsJx |D]}|ipqn|SWt|ƒot|d_|dSdS(Ni(RTR=RS(R'RJ((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyRAqs   cCsl|djo|ii}nd}xB|D]:}t|tƒo$||id||ifƒ7}q*q*W|S(s&returns a string in gdt representationR7s%s.%sN(R1t __class__RR¯RttostrRR(R't prefix_stringtmstrR)((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR¸{s  cCs±t|ƒdjodS|ddjo |d=ndSx;|D]3}|i|djo|i|d|ƒdSq?Wtƒ}|i|ƒ|d|_|i|d|ƒdS(NiiR.(R=RRtfromstrRR-(R'tvalsR)R©RJ((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR»ˆs     (RRR0RKR@RmRtR‹R1R¬R®RSR¶RAR¸R»(((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR.9s  ( Q ) - ÿ1  cCsHtdjp|pttƒjo tƒatiƒtƒantS(N(t__PFListR1t __PFList_rootRR.RK(trefresh((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyR§žs    s Harald Hoyer (.tos.pathR!t netconfpkgRRtnetconfpkg.NCDeviceListRtnetconfpkg.NCProfileRtnetconfpkg.NC_functionsRRRRRR R R R R RRRRRRRRRRRtnetconfpkg.confRRtnetconfpkg.gdtRRRR%R R.R1R½R¾R§t __author__(((s</usr/share/system-config-network/netconfpkg/NCProfileList.pyts ˆÿÿd