Commit 1dfe43ca authored by mgiuca's avatar mgiuca Committed by Commit bot

Simplify octal constants in Python code (e.g. 0o0700 -> 0o700).

Review-Url: https://codereview.chromium.org/2075923003
parent edbf9a3e
...@@ -155,7 +155,7 @@ class GerritTestCase(unittest.TestCase): ...@@ -155,7 +155,7 @@ class GerritTestCase(unittest.TestCase):
"""Sets up the gerrit instances in a class-specific temp dir.""" """Sets up the gerrit instances in a class-specific temp dir."""
# Create gerrit instance. # Create gerrit instance.
gerrit_dir = tempfile.mkdtemp() gerrit_dir = tempfile.mkdtemp()
os.chmod(gerrit_dir, 0o0700) os.chmod(gerrit_dir, 0o700)
gi = cls.gerrit_instance = cls._create_gerrit_instance(gerrit_dir) gi = cls.gerrit_instance = cls._create_gerrit_instance(gerrit_dir)
# Set netrc file for http authentication. # Set netrc file for http authentication.
...@@ -188,7 +188,7 @@ class GerritTestCase(unittest.TestCase): ...@@ -188,7 +188,7 @@ class GerritTestCase(unittest.TestCase):
def setUp(self): def setUp(self):
self.tempdir = tempfile.mkdtemp() self.tempdir = tempfile.mkdtemp()
os.chmod(self.tempdir, 0o0700) os.chmod(self.tempdir, 0o700)
def tearDown(self): def tearDown(self):
if TEARDOWN: if TEARDOWN:
......
...@@ -240,7 +240,7 @@ class GitRepo(object): ...@@ -240,7 +240,7 @@ class GitRepo(object):
SPECIAL_KEY: special_value, SPECIAL_KEY: special_value,
... ...
"path/to/some/file": { 'data': "some data content for this file", "path/to/some/file": { 'data': "some data content for this file",
'mode': 0o0755 }, 'mode': 0o755 },
... ...
} }
......
...@@ -175,7 +175,7 @@ class GitReadOnlyFunctionsTest(git_test_utils.GitRepoReadOnlyTestBase, ...@@ -175,7 +175,7 @@ class GitReadOnlyFunctionsTest(git_test_utils.GitRepoReadOnlyTestBase,
COMMIT_C = { COMMIT_C = {
'some/files/file2': { 'some/files/file2': {
'mode': 0o0755, 'mode': 0o755,
'data': 'file2 - vanilla\n'}, 'data': 'file2 - vanilla\n'},
} }
...@@ -750,7 +750,7 @@ class GitFreezeThaw(git_test_utils.GitRepoReadWriteTestBase): ...@@ -750,7 +750,7 @@ class GitFreezeThaw(git_test_utils.GitRepoReadWriteTestBase):
COMMIT_C = { COMMIT_C = {
'some/files/file2': { 'some/files/file2': {
'mode': 0o0755, 'mode': 0o755,
'data': 'file2 - vanilla'}, 'data': 'file2 - vanilla'},
} }
......
...@@ -232,7 +232,7 @@ class GitHyperBlameSimpleTest(GitHyperBlameTestBase): ...@@ -232,7 +232,7 @@ class GitHyperBlameSimpleTest(GitHyperBlameTestBase):
COMMIT_B = { COMMIT_B = {
'some/files/file2': { 'some/files/file2': {
'mode': 0o0755, 'mode': 0o755,
'data': 'file2 - vanilla\n'}, 'data': 'file2 - vanilla\n'},
'some/files/empty': {'data': 'not anymore'}, 'some/files/empty': {'data': 'not anymore'},
'some/files/file3': {'data': 'file3'}, 'some/files/file3': {'data': 'file3'},
......
...@@ -528,10 +528,10 @@ class HttpRpcServer(AbstractRpcServer): ...@@ -528,10 +528,10 @@ class HttpRpcServer(AbstractRpcServer):
pass pass
else: else:
# Create an empty cookie file with mode 600 # Create an empty cookie file with mode 600
fd = os.open(self.cookie_file, os.O_CREAT, 0o0600) fd = os.open(self.cookie_file, os.O_CREAT, 0o600)
os.close(fd) os.close(fd)
# Always chmod the cookie file # Always chmod the cookie file
os.chmod(self.cookie_file, 0o0600) os.chmod(self.cookie_file, 0o600)
else: else:
# Don't save cookies across runs of update.py. # Don't save cookies across runs of update.py.
self.cookie_jar = cookielib.CookieJar() self.cookie_jar = cookielib.CookieJar()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment