Commit a8c7a0f662098c870112474ff7f4972d08a89dd3
1 parent
cb33ac1f
Exists in
master
Pequenas coisas para adaptar depois ao json do getConfig() na coleta.
Showing
3 changed files
with
28 additions
and
1 deletions
Show diff stats
cacic-daemon/cacicD/cacictimer.cpp
| ... | ... | @@ -257,7 +257,7 @@ void CacicTimer::verificarModulos(){ |
| 257 | 257 | } |
| 258 | 258 | delete fileOld; |
| 259 | 259 | delete fileNew; |
| 260 | - lerArquivoConfig(jsonConfig); | |
| 260 | + lerArquivoConfig(jsonConfig["agentcomputer"].toObject()); | |
| 261 | 261 | int countExecNotFound = 0; |
| 262 | 262 | QMap<QString, QString>::const_iterator mapIterator = moduleMap.constBegin(); |
| 263 | 263 | while (mapIterator != moduleMap.constEnd()) { | ... | ... |
gercols/gercols.cpp
| ... | ... | @@ -16,6 +16,7 @@ Gercols::Gercols(QObject *parent) |
| 16 | 16 | |
| 17 | 17 | oCacic.setJsonToFile(configTeste,"configReq.json"); |
| 18 | 18 | /*************************************************************************/ |
| 19 | + | |
| 19 | 20 | oColeta = new CColeta; |
| 20 | 21 | //Pega chave do registro, que será pega na instalação. |
| 21 | 22 | oCacic.setChaveCrypt(oCacic.getValueFromRegistry("Lightbase", "Cacic", "key").toString()); |
| ... | ... | @@ -32,7 +33,11 @@ void Gercols::run() |
| 32 | 33 | //emite sinal para começar a coleta |
| 33 | 34 | emit iniciaColeta(); |
| 34 | 35 | |
| 36 | + /* Json de teste sendo excluído | |
| 37 | + */ | |
| 35 | 38 | oCacic.deleteFile("configReq.json"); |
| 39 | + /***********************************/ | |
| 40 | + | |
| 36 | 41 | oColeta->waitToCollect(); |
| 37 | 42 | //salva json em arquivo |
| 38 | 43 | if (!oColeta->toJsonObject().isEmpty()) | ... | ... |
src/ccoleta.cpp
| ... | ... | @@ -42,6 +42,7 @@ bool CColeta::waitToCollect() |
| 42 | 42 | |
| 43 | 43 | void CColeta::run() |
| 44 | 44 | { |
| 45 | + /* Versão do json de testes */ | |
| 45 | 46 | QJsonObject coleta = oCacic.getJsonFromFile("configReq.json"); |
| 46 | 47 | |
| 47 | 48 | if( coleta.contains("hardware") ){ |
| ... | ... | @@ -54,6 +55,27 @@ void CColeta::run() |
| 54 | 55 | emit beginSoftware(); |
| 55 | 56 | } else |
| 56 | 57 | this->softwareIsFinish = true; |
| 58 | + /************************************************************/ | |
| 59 | + | |
| 60 | + | |
| 61 | + /* Versão do json definitiva, obtiva através do getConfig() | |
| 62 | + QJsonObject coleta = oCacic.getJsonFromFile("getConfig.json")["agentcomputer"].toObject(); | |
| 63 | + | |
| 64 | + foreach ( QJsonValue action, coleta["actions"].toArray() ){ | |
| 65 | + QJsonObject jsonAction = action.toObject(); | |
| 66 | + | |
| 67 | + if( jsonAction.contains("col_hard") && jsonAction["col_hard"] == QJsonValue.fromVariant(QString("true")) ){ | |
| 68 | + this->hardwareIsFinish = false; | |
| 69 | + emit beginHardware(); | |
| 70 | + } else | |
| 71 | + this->hardwareIsFinish = true; | |
| 72 | + if ( jsonAction.contains("col_soft") && jsonAction["col_soft"] == QJsonValue.fromVariant(QString("true")) ){ | |
| 73 | + this->softwareIsFinish = false; | |
| 74 | + emit beginSoftware(); | |
| 75 | + } else | |
| 76 | + this->softwareIsFinish = true; | |
| 77 | + } | |
| 78 | + /************************************************************/ | |
| 57 | 79 | |
| 58 | 80 | } |
| 59 | 81 | ... | ... |