Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Unified Diff: remoting/tools/me2me_virtual_host.py

Issue 10106013: Chromoting: stopping the service if the host ID is permanently not recognized by the could. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feeback. Rebased. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/remoting.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/tools/me2me_virtual_host.py
diff --git a/remoting/tools/me2me_virtual_host.py b/remoting/tools/me2me_virtual_host.py
index 69994d0be6f1c4bff823a408954840abab13f14a..f797648685f280c9f460ec2745035cd1f17d8e21 100755
--- a/remoting/tools/me2me_virtual_host.py
+++ b/remoting/tools/me2me_virtual_host.py
@@ -731,14 +731,24 @@ def main():
logging.info("Host process terminated")
desktop.host_proc = None
- # The exit-code must match the one used in HeartbeatSender.
- if os.WEXITSTATUS(status) == 100:
+ # These exit-codes must match the ones used by the host.
+ # See remoting/host/constants.h.
+ # Delete the host or auth configuration depending on the returned error
+ # code, so the next time this script is run, a new configuration
+ # will be created and registered.
+ if os.WEXITSTATUS(status) == 2:
+ logging.info("Host configuration is invalid - exiting.")
+ os.remove(auth.config_file)
+ os.remove(host.config_file)
+ return 0
+ elif os.WEXITSTATUS(status) == 3:
logging.info("Host ID has been deleted - exiting.")
- # Host config is no longer valid. Delete it, so the next time this
- # script is run, a new Host ID will be created and registered.
os.remove(host.config_file)
return 0
-
+ elif os.WEXITSTATUS(status) == 4:
+ logging.info("OAuth credentials are invalid - exiting.")
+ os.remove(auth.config_file)
+ return 0
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
« no previous file with comments | « remoting/remoting.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698