Add --follow to update_engine_client that follows any AU operation to completion.
Before, this ability was nested in with -update, this CL separates the logic
into a --follow flag. To keep existing behavior, I'm forcing --follow to true
when --update is set.
In this CL I also sort the flags variables and clean up some of the logic.
Now all flags should work together except for explicitly mutually exclusive
flags which I noted in the code (this removes early return 0's).
Finally I changed all the LOG(FATAL)'s to LOG(ERROR)'s because the fatals
throw a stack trace which isn't valuable.
BUG=chromium:309051
TEST=Ran
-rollback with and without -follow (found bug with policy that I also fixed.
tested also with update, check_for_update, status, watch_for_status_updates
and app_version.
Change-Id: I1bc1d5bf760af1df117172443112c4ad5864d8a3
Reviewed-on: https://chromium-review.googlesource.com/174905
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index 34cd575..fb4d223 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -727,7 +727,7 @@
// Enterprise-enrolled devices have an empty owner in their device policy.
string owner;
const policy::DevicePolicy* device_policy = system_state_->device_policy();
- if (!device_policy->GetOwner(&owner) || owner.empty()) {
+ if (device_policy && (!device_policy->GetOwner(&owner) || owner.empty())) {
LOG(ERROR) << "Enterprise device detected. "
<< "Cannot perform a powerwash for enterprise devices.";
return false;