diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-17 22:30:54 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-17 22:30:54 +0000 |
commit | ac31b78b597398068972d7858ec69fa1efb87621 (patch) | |
tree | 2fbd1b70dddeea64695b1e8329a58949d3910c94 /remoting/tools/me2me_virtual_host.py | |
parent | 00270a9dcafa351e1465c92b1fce30d9639f03cc (diff) | |
download | chromium_src-ac31b78b597398068972d7858ec69fa1efb87621.zip chromium_src-ac31b78b597398068972d7858ec69fa1efb87621.tar.gz chromium_src-ac31b78b597398068972d7858ec69fa1efb87621.tar.bz2 |
Chromoting: stopping the service if a permanent error is encountered (such as the host ID is permanently not recognized by the could or invalid host configuration).
BUG=123715,112160
Review URL: http://codereview.chromium.org/10106013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/tools/me2me_virtual_host.py')
-rwxr-xr-x | remoting/tools/me2me_virtual_host.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/remoting/tools/me2me_virtual_host.py b/remoting/tools/me2me_virtual_host.py index 69994d0..f797648 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) |