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

Unified Diff: sky/tools/skypy/skyserver.py

Issue 1161133002: Fix sky_server.py on Mac and make sky_server executable if it's not already (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/skypy/skyserver.py
diff --git a/sky/tools/skypy/skyserver.py b/sky/tools/skypy/skyserver.py
index d161eb0ddd458fd0ced042b0fa0b17daa13fd61a..970437d070322661aaa554bc2fe353a0e3f06977 100644
--- a/sky/tools/skypy/skyserver.py
+++ b/sky/tools/skypy/skyserver.py
@@ -6,6 +6,7 @@ import socket
import subprocess
import logging
import os.path
+import stat
import platform
SKYPY_PATH = os.path.dirname(os.path.abspath(__file__))
@@ -32,10 +33,10 @@ class SkyServer(object):
if platform.system() == 'Linux':
platform_dir = 'linux64'
- elif platform.system() == 'Mac':
+ elif platform.system() == 'Darwin':
platform_dir = 'mac'
else:
- assert False, 'No sky_server binary for this platform?'
+ assert False, 'No sky_server binary for this platform: ' + platform.system()
return os.path.join(SKYGO_PATH, platform_dir, 'sky_server')
@@ -47,6 +48,10 @@ class SkyServer(object):
return
server_path = self.sky_server_path()
+ st = os.stat(self.sky_server_path())
+ if not (stat.S_IXUSR & st[stat.ST_MODE]):
+ logging.warn('Changing the permissions of %s to be executable.', self.sky_server_path())
+ os.chmod(self.sky_server_path(), st[stat.ST_MODE] | stat.S_IEXEC)
server_command = [
server_path,
'-t', self.configuration,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698