Skip to content

Commit

Permalink
Merge pull request #902 from subutai-io/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
crioto authored Apr 25, 2018
2 parents 2b78725 + 2ed359e commit 8c23c43
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions hub/src/SystemCallWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,25 +350,35 @@ QString CSystemCallWrapper::vagrant_status(const QString &dir){
return QString("broken");
}
QString st = "";
bool reading_path = false;
for(auto s : res.out){
st="";
reading_path = false;
status = "";
for (int i=0; i < s.size(); i++){
if(s[i] == ' ' || s[i] == '\r' || s[i] == '\t'){
if (reading_path){
st += s[i];
if(st == dir){
qDebug()
<<dir<<"status is"<<status;
return status;
}
}
else if(s[i] == ' ' || s[i] == '\r' || s[i] == '\t'){
if(st == "running"){
status = st;
}
if(st == "poweroff"){
status = st;
}
if(st == dir){
qDebug()
<<dir<<"status is"<<status;
return status;
}
st = "";
}
else
else{
if(!status.isEmpty()){
reading_path = true;
}
st += s[i];
}

}
}
Expand Down

0 comments on commit 8c23c43

Please sign in to comment.