Changeset 9098f87


Ignore:
Timestamp:
08/07/15 07:24:51 (4 weeks ago)
Author:
Ken Moore <moorekou@…>
Branches:
master, stable/10
Children:
1d2f602
Parents:
bc68c91
Message:

Add a special syscache client/server flag to indicate whether outputs need to be in CLI format or not.

Location:
src-sh/syscache/daemon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-sh/syscache/daemon/DB.cpp

    r96980ce r9098f87  
    8585} 
    8686 
    87 QString DB::fetchInfo(QStringList request){ 
     87QString DB::fetchInfo(QStringList request, bool noncli){ 
    8888  if(HASH->isEmpty()){  
    8989    startSync(); 
    9090    QCoreApplication::processEvents(); 
    91     pausems(500); //wait 1/2 second for sync to start up 
     91    pausems(200); //wait 1/5 second for sync to start up 
    9292  } 
    9393         
     
    273273      if(sortnames && !val.isEmpty()){ val = sortByName(val.split(LISTDELIMITER)).join(LISTDELIMITER); } 
    274274    } 
    275     val.replace(LISTDELIMITER, ", "); 
     275    if(!noncli){ val.replace(LISTDELIMITER, ", "); } //for CLI requests, put lists in a comma-delimited order 
    276276    if(val.isEmpty()){ val = " "; } //make sure it has a blank space at the minimum 
    277277  } 
  • src-sh/syscache/daemon/DB.h

    r00116bd r9098f87  
    9393        void shutDown(); 
    9494 
    95         QString fetchInfo(QStringList request); 
     95        QString fetchInfo(QStringList request, bool noncli = false); 
    9696        //Request Format: [<type>, <cmd1>, <cmd2>, .... ] 
    9797 
  • src-sh/syscache/daemon/syscache-daemon.cpp

    r2c5a0c7f r9098f87  
    7676  QTextStream stream(curSock); 
    7777  bool done = false; 
     78  bool nonCLI = false; 
    7879  while(!stream.atEnd()){ 
    7980    req.clear(); 
     
    8283    if(!line.contains("[/]")){ usleep(600); QCoreApplication::processEvents(); line.append(stream.readLine()); } 
    8384    if(line.contains("[FINISHED]")){done = true; } 
     85    if(line.contains("[NONCLI]")){ nonCLI = true; } 
    8486    if(line.contains("[")){ line = line.section("[",0,0); } 
    8587    if(line.isEmpty() || line == "[/]"){ continue; } 
     
    116118    else{  
    117119         
    118       QString res = DATA->fetchInfo(req); 
     120      QString res = DATA->fetchInfo(req, nonCLI); 
    119121      //For info not available, try once more time as it can error unexpectedly if it was  
    120122        // stuck waiting for a sync to finish 
Note: See TracChangeset for help on using the changeset viewer.