XׯdEbddlZddlZddlZddlZddlmZddlmZmZddlm Z ddl m Z m Z m Z ddlmZdZdd Zd Zd ZGd deZGddeZGddeZdZGddeZdS)N) DBLoginError) WizardPageWizardProgressPage)replace_string_parameters)get_connection_parametersget_odbc_connection_stringis_odbc_connection) log_errorc ddl}ddl} |jdkr|ddddd|gdkS|jdkr|dd dd d |gdkS|dd dd d |gdkS#Yd SxYw) Nrwin32pingz-n1z-w3000darwinz-cz-t3F)sys subprocessplatformcall)hostnamerrs (..\modules\migration_source_selection.py ping_hostr!sJJJ <7 " "??FD#tVX#NOOSTT T \X % %??FD#tS(#KLLPQQ Q??FD#tS(#KLLPQQ Quus)A=)A=A==BFc^|jjD]}|jdvr|jdkrx|r|sEt|d}|jd}t ||dd\}}tj d|z|||\}}|r|cSn|j d cSndS) N)keychainpasswordrT)do_not_transformstorageKeyFormatz::zEnter password for user r) driver parameters paramTyperparamTypeDetailsrsplitmforms Utilitiesfind_or_ask_for_passwordparameterValues) connectionusernamestorage_string forget_oldparamconnection_paramsstorage_key_formatacceptedpasswds rrequest_passwordr2.s"-   ?6 6 6*,,~(A*_c(d(d(d%).)?@R)S&/HI[]n/o/o/u/uvz|}/~/~,Hn#)#3#L#LMgjrMruCEMOY$Z$Z &"!MMM""1*==== E 7 4c d}d}|jjjdkr9|jjdkr(|jd}|jdd}n6|jdd}|jdd}|r|rddl}ddl}||j|j}| d | ||fnQ#|j $r}|jdkr2tj |d d |zzd zd d d Yd}~dStj |d|jzdzdzdzdzdzd d d Yd}~dSd}~w|j$r}t#|r:tj |d|d|d|ddzdzdzdzd d d n9tj |d|d|ddzdzdzdzdzd d d Yd}~dSd}~w|j$r$}|j|jkrt#|r7tj |d|d|ddzdzdzdzd d d ntj |d|d|d|jddzdzdzdzdzd d d nt#|r8tj |d|jzdzdzdzdzd d d n:tj |d|jzdzdzdzdzdzd d d Yd}~dSd}~wwxYw|dSdS) NMysql MysqlNativehostNameporti r z>Unable to connect to the provided host and port combination. zCould not resolve %s z>Make sure that the provided hostname or IP address is correct.OKrFzBUnable to connect to the provided host and port combination. %s zMake sure that: z1- the provided hostname or IP address is correct zK- the database server is running and listening in the provided port number z[- the machine hosting the database server allows external connections to the database port z1- your network connection is properly functioningzTimed out connecting to :z&, although the host could be pinged. z z0- the provided hostname or IP address is correctz. zConnection refused at zError connecting to zhTimed out connecting to the provided host and port combination, although the host could be pinged. %s zETimed out connecting to the provided host and port combination. %s T)r ownernamer(getsocketerrnoAF_INET SOCK_STREAM settimeoutconnectgaierrorr%r& show_messagestrerrortimeoutrerror ECONNREFUSEDclose) r) error_titlerr8r@rAserres rtest_connectivityrQ@s:H D#w..   !] 2 2!1*=H-11&$??D-11*dCC)--fd;;VDV  MM&.&*< = = RN  IIx& ' ' ' '   yA~~ --kZ08;<XYZ^`bdfhhhuuuuu --k`cfcoo+,LMggw w L L b"&&&uuuuu~   "" & --kkiqiqiqswswswyzyzyz{+,fgwwK K b" &&&& --kk@H$$$O+,LMggw w L L b"&&&55555|' ' ' yE...X&&*$11++emememososost/0jk{{O O !"b ****$11++FNhhPTPTPTVYVbVbVbc/0PQkk{ { P P !"b****X&&*$11+KNQNZZ/0jk{{O O !"b ****$11+gjmjvv/0PQkk{ { P P !"b***55555O' P  t 4s8 C&& L407E--:E-- L4:BHL4DL//L4cRtjdd|zddddS)NzConnect to ODBC SourcezThe ODBC driver that was selected for the source connection was not found by the ODBC manager. Ensure that you have the proper ODBC driver installed and retry. Error Text: %sr;r)r%r& show_error)rPs rshow_missing_driver_errorrTs>  8   !"&B00000r3c eZdZdZdZdZdS)SourceWizardPagec|jr|jddS|jddS)NTF)_store_connection_check get_active_store_connection_entry set_enabledselfs r_toggle_store_connectionz)SourceWizardPage._toggle_store_connectionsS  ' 2 2 4 4 <  ( 4 4T : : : : :  ( 4 4U ; ; ; ; ;r3c|j}|s3tjdddddtjkrdSd}t jjj j D]}|j |krd}nt jjj j D]}|j |krd}n|r6tjdd|zd d dtjkrdS |j |nH#t$r;}tjdt#|dddYd}~dSd}~wwxYwdS) NzStore Connectionz2A name must be provided for saving the connection.r;SkiprFTzDThere already is a connection named '%s'. Do you want to replace it?zReplace ConnectionCancel)rZget_string_valuer%r&rGResultOkgrtrootwb rdbmsMgmt storedConnsr>otherStoredConnspanelsaveConnectionAs ExceptionrSstr)r]r>dupconrPs rsave_connectionz SourceWizardPage.save_connections+<<>> ,,-?Auw{~DFHIIMSM\\\u8;(4  Cx4 8;(9  Cx4   ,,-?BHKOBO$8(BHHKQ?[[u  J ' ' - - - -      ' '(:CFFD"b Q Q Q55555 ts$C?? E 0D??Ec tjj}|d|zt |jd|zdkr|d|zdS|d|zd}d}d}t |j} |std | |d |ztj d|zd d dd|j d|_ dS#ttf$r}|dkrBd t|vr1dt|vr |dt!|Yd}~dS|dkrt#|tr|sd}n|d |rdt%|jdz}t|} | drBd| vr> t)| d| ddz iid} n#YnxYwtj d|zd|d| |d ddYd}~dS|dz }|jjj} |jj} t3|j| | ||_ |j dkr,tj d|zdd ddYd}~dSYd}~nd}~wt6j$r;}tj dt|d ddYd}~dSd}~wt$r}t;d|z|d|z|rdt%|jdz}t|} | dr4| drt)| ddiid} tj d|zd | |d ddYd}~nd}~wwxYwQ)!Nz,Testing network connectivity to %s Server...zTest %s DBMS ConnectionFz %s server could not be contactedz Testing connection to %s DBMS...rrTzCould not connect to DBMSz%s DBMS connection is OKzConnection succeeded.r;[Driver Manager]image not foundzSpecified ODBC driver not foundz ODBC connection string: %szzError(z: error calling z):rzCould not connect to z DBMS. zOperation cancelledzUnsupported Connection Methodz!Exception testing connection: %s zCould not connect to DBMS: %s)zCould not connect to the DBMS. )r%Appr?set_status_textrQr)r rErl disconnectr&rGrr SystemErrorrmrT isinstancer startswithevalrfindr(userNamehostIdentifierr2rS migrationNotSupportedErrorr endswith) r]sourcecaptionryforce_passwordattemptextrais_odbcrPetextr*r+s rtest_connectionz SourceWizardPage.test_connections4 *..**:FPQQQ V.0IG0S T TX] ] ] O>H I I I F:WDEEE$V%6774 Z3 Z~~''A#$?@@@!!### :W DEEE --.G'.QSjlprtvxyyy?*&(FO +.   a<<$6#a&&$@$@EVZ]^_Z`Z`E`E`#O$EFFF-a000FFFFFq[[!!\22 > )-'(CDDD"H$DGabhbsvGHHHH%HE #A ++H55%:LPU:U:U%(,U1U[[5F5Fq5H3H-I2r(R(RST(U% $(556ORY6Y6YELELELNSNSUZUZ\[]acegijjj1 !,<E!'!2!A"263DhP^`n"o"o?d**$//0IG0SUjlprtvxyyyEEEEE+****.    --.MsSTvvW[]_acddd Z Z Z>BCCC ?! CDDD@>> %%&7888!+-- !!";<<< --dn=== D,eT:::::r3c|jj|jj||jjjddS)NSource)rplansetSourceConnectionrjr)rmigrationSourcer\s r go_advancedzSourceMainView.go_advancedIB **4:+@AAA TY^;XFFFFFr3c|jr0|sdS|jd|jj|jjt |dSNF) rXrYrp set_activerrrrjr)rVgo_nextr\s rrzSourceMainView.go_nextM  ' 2 2 4 4 ;''))   ( 3 3E : : : **4:+@AAA  &&&&&r3ctjjs%tjddddddSdS)Nrz.ODBC Administrator utility could not be found.r;r)rdmodules PyWbUtilsstartODBCAdminr%r&rSr\s rrzSourceMainView.open_odbcWse{$3355 C   ' '(ACsuy{}@B C C C C C C Cr3N)rrrrrrrrrr3rrrskLLL%;%;%;RGGG'''CCCCCr3rc,eZdZdZdZdZdZdZdS)TargetMainViewcvt||d|j|dddS)NzTarget Selectionr)rVrrrr]rs rrzTargetMainView.__init__^s<!!$.@AAA !!$8JKKKKKr3cdS)Nrr\s rjust_script_toggledz"TargetMainView.just_script_toggledds r3ctjd|_|jdtjd}|tj|j|ddtj |_ |j tj jjtj|j j}|j|ddtjd}tj|_|jd|j|j||jddtj|_|jd||jdd|jd|j|dd|j|jdd|jddS)NFr:z"Target RDBMS Connection ParametersTrrr)r%rrrrrrrrdrrrj initializererfrgrrrrXrrr^rrZrr[rrrs rrzTargetMainView.create_uigs#)=#7#7   ,,Q///)MNN  !1222  $$^UDAAA[3355  chk3444~djo..  $$T4666mD!!'-'9';';$ $--.UVVV $99$:WXXX ,eT:::'-':'<'<$ $--.EFFF ,dD999 $00777  $$S%666 14>>> %%&788888r3c|jr0|sdS|jd|jj|jjt |dSr) rXrYrprrrsetTargetConnectionrjr)rVrr\s rrzTargetMainView.go_nextrr3c|jj|jj||jjjddS)NTarget)rrrrjr)rmigrationTargetr\s rrzTargetMainView.go_advancedrr3N)rrrrrrrrrr3rrr]shLLL    "9"9"9H'''GGGGGr3ra^The following tasks will now be performed. Please monitor the execution. The names of available schemas will be retrieved from the source RDBMS. The account used for the connection will need to have appropriate privileges for listing and reading the schemas you want to migrate. Target RDBMS connection settings will also be checked for validity. c2eZdZdZdZdZdZdZdZdS)FetchProgressViewc.tj||dtd|_||jdd||jdd||jdd |j |d d dS) NzFetch Schema List) descriptionTzConnect to source DBMSzConnect to Source DBMSzCheck target DBMS connectionzCheck Target DBMS Connectionz Retrieve schema list from sourcez Retrieve Schema List From SourcerzFetch Schemas List) rrPAGE_DESCRIPTION _autostartadd_task task_connecttask_test_targetadd_threaded_tasktask_fetch_schematarrrs rrzFetchProgressView.__init__s#D$0CQabbbb d')AC[\\\ d+-KMklll t79[] A A A !!$8LMMMMMr3cHt|ddS)N;z; )rmreplace)r]rPs rformat_exception_textz'FetchProgressView.format_exception_texts1vv~~c5)))r3c0tjddd}d} |jjjst d|jjjjd|jjj_|jjjdS#ttf$r}|dkr7dt|vr&d t|vrt|Yd}~dS|dkrt|tr|sd}n||d z }|jjjjjj}|jjjjj}t%|jjjj||||jjj_Yd}~nd}~wwxYw}) NrwzConnecting to source...FrTz!Could not connect to source RDBMSrrrrsr)rd send_progressrrrrErlr checkVersionrr{rmrTr|r)r(rrr2)r]rrrPr*r+s rrzFetchProgressView.task_connects "7888 ` `y~5==??I#$GHHH9>1:B>@DIN2; .;;=== +. ` ` `a<<)SVV338ISQRVV8S8S1!444Q;;!!\22 > )- 1 9>9DT]!%!?!J!Y:J49>KiKtv~AOQ_;`;` .777777 ` `sBBF07F-BFFcX|dtj|dS)NT)resetrgo_backr\s rrzFetchProgressView.go_backs+ 4"4(((((r3c |jjjj}d|jvr|jdr|jdgng}|jjj||jjjdS)Nschema)rrrr)r(doFetchSchemaNamesrz)r]r)only_these_catalogss rrz%FetchProgressView.task_fetch_schematasY^3> KSWaWqKqKqwAwQRZw[Kq!;H!E F FLN  &99:MNNN &1133333r3ctjddd}|jjjjj|jjjjjkrn|jjjjjd|jjjjjdkr*|jjjj |jjj_ d} |jjj std|jjjj d|jjj_ |jjj dS#ttf$r}|dkrt|tr|sd}n||d z }|jjjjjj}|jjjjj}t#|jjjj|||jjj_ Yd}~nd}~wwxYw?) NrwzConnecting to target...rrFTz!Could not connect to target RDBMSrr)rdrrrrr)rrr(rcheckConnectionrlrrr{r|rr2)r]rrrPr*r+s rrz"FetchProgressView.task_test_targets "7888 9> ) 4 Cty~GeGpG  y~-8HTX\XaXfXvYBYRS]Y^^^:>).:X:a .7 P Py~5EEGGI#$GHHH9>1:B>@DIN2; .;;=== +. P P PQ;;!!\22 > )-1 9>9DT]!%!?!J!Y:J49>KiKtv~AO;P;P .777777 P PsBEG;BG66G;N) rrrrrrrrrrr3rrrsyNNN***```8))) 444PPPPPr3r)rrF)rdr%rrer workbench.uirrworkbench.utilsrworkbench.db_driverrrr workbench.logr rr2rQrTrVrrrrrr3rrs,  77777777555555iiiiiiiiii######   $dddN000fZfZfZfZfZzfZfZfZRBCBCBCBCBC%BCBCBCL:G:G:G:G:G%:G:G:GzQPQPQPQPQP*QPQPQPQPQPr3