Fix for StepParseManifest for recovery 33/121233/1
authorBartlomiej Kunikowski <b.kunikowski@partner.samsung.com>
Fri, 24 Feb 2017 08:06:57 +0000 (09:06 +0100)
committerBartlomiej Kunikowski <b.kunikowski@partner.samsung.com>
Mon, 27 Mar 2017 08:58:18 +0000 (10:58 +0200)
When some installation process failing, there may
exists invalid manifest file, so recovery process
should check this situation.

Change-Id: Iab06f8748731def99703be5cc6030b4828c72053

src/common/step/configuration/step_parse_manifest.cc

index cf84ba8..5c37b4b 100644 (file)
@@ -973,6 +973,11 @@ Step::Status StepParseManifest::process() {
   }
   parser_.reset(new tpk::parse::TPKConfigParser());
   if (!parser_->ParseManifest(path_)) {
+    if (manifest_location_ == ManifestLocation::RECOVERY) {
+      LOG(DEBUG) << "Manifest for recovery is invalid";
+      bf::remove(path_);
+      return Step::Status::OK;
+    }
     LOG(ERROR) << "[Parse] Parse failed. " <<  parser_->GetErrorMessage();
     return Step::Status::PARSE_ERROR;
   }