Changeset a31b84b


Ignore:
Timestamp:
08/25/14 07:31:39 (2 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.3
Children:
0519462, 5f61d1e
Parents:
18d1745
Message:

Fix a few bugs in the life preserver GUI.
1) Make sure we don't prompt for the SSH key update if we are de-activating the replication.
2) Update the lpreserver replicate remove syntax to reflect the new backend syntax (needed remote host input now).

Location:
src-qt4/life-preserver/lp-gui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/life-preserver/lp-gui/LPBackend.cpp

    r615eea1 ra31b84b  
    216216} 
    217217 
    218 bool LPBackend::removeReplication(QString dataset){ 
    219   QString cmd = "lpreserver replicate remove "+dataset; 
     218bool LPBackend::removeReplication(QString dataset, QString remotehost){ 
     219  QString cmd = "lpreserver replicate remove "+dataset+" "+remotehost; 
    220220  int ret = LPBackend::runCmd(cmd);      
    221221    
  • src-qt4/life-preserver/lp-gui/LPBackend.h

    r7b6669b ra31b84b  
    3131        //Replication Management 
    3232        static bool setupReplication(QString dataset, QString remotehost, QString user, int port, QString remotedataset, int time); 
    33         static bool removeReplication(QString dataset); 
     33        static bool removeReplication(QString dataset, QString remotehost); 
    3434        static bool replicationInfo(QString dataset, QString& remotehost, QString& user, int& port, QString& remotedataset, int& time); 
    3535        //SSH Key Management 
  • src-qt4/life-preserver/lp-gui/LPConfig.cpp

    r2a47654 ra31b84b  
    127127  if(isReplicated && remoteChanged){ updateSSHKey = true; } 
    128128  QString tmp = ui->lineHostName->text().simplified(); 
    129   if( tmp != remoteHost ){ remoteChanged = true; remoteHost = tmp; updateSSHKey=true;} 
     129  //Only change the backend remoteHost value if the replication is still enabled (so de-activation will work properly) 
     130  if( tmp != remoteHost && isReplicated){ remoteChanged = true; remoteHost = tmp; updateSSHKey=true;} 
    130131  tmp = ui->lineUserName->text().simplified(); 
    131132  if( tmp != remoteUser ){ remoteChanged = true; remoteUser = tmp; updateSSHKey=true;} 
     
    150151  if( nFreq != remoteFreq ){ remoteChanged = true; remoteFreq = nFreq; } 
    151152   
    152   if(updateSSHKey){ 
     153  if(updateSSHKey && isReplicated && remoteChanged){ 
    153154    //Prompt for the SSH key generation 
    154155    LPBackend::setupSSHKey(remoteHost, remoteUser, remotePort); 
  • src-qt4/life-preserver/lp-gui/LPMain.cpp

    r615eea1 ra31b84b  
    433433      ui->statusbar->showMessage(QString(tr("Removing replication: %1")).arg(ds),0); 
    434434      qDebug() << "Removing Replication:" << ds; 
    435       LPBackend::removeReplication(ds); 
     435      LPBackend::removeReplication(ds, CFG.remoteHost); 
    436436    } 
    437437    ui->statusbar->clearMessage(); 
     
    502502        ui->statusbar->showMessage(QString(tr("%1: Disabling Replication")).arg(ds),0); 
    503503        showWaitBox(tr("Disabling Replication")); 
    504         LPBackend::removeReplication(ds);  
     504        //Need the replication host 
     505        QString rhost, junk1,junk3; 
     506        int junk2, junk4; 
     507        LPBackend::replicationInfo(ds, rhost, junk1, junk2, junk3, junk4); 
     508        LPBackend::removeReplication(ds,rhost);  
    505509        ui->statusbar->clearMessage();       
    506510      } 
Note: See TracChangeset for help on using the changeset viewer.