You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/02/10 22:44:48 UTC

[allura] 17/41: [#8349] python-modernize -n -w --no-diffs -f numliterals .

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8349
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 215ee5f6b8ca2a66bbd8643b33f80d1145679971
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Feb 10 14:12:11 2020 -0500

    [#8349] python-modernize -n -w --no-diffs -f numliterals .
---
 Allura/allura/lib/multifactor.py    | 2 +-
 Allura/ldap-setup.py                | 4 ++--
 Allura/ldap-userconfig.py           | 6 +++---
 ForgeGit/forgegit/model/git_repo.py | 2 +-
 ForgeSVN/forgesvn/model/svn.py      | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Allura/allura/lib/multifactor.py b/Allura/allura/lib/multifactor.py
index 29ea612..c120a16 100644
--- a/Allura/allura/lib/multifactor.py
+++ b/Allura/allura/lib/multifactor.py
@@ -258,7 +258,7 @@ class GoogleAuthenticatorPamFilesystemMixin(object):
         if autocreate:
             userdir = os.path.dirname(self.config_file(user))
             if not os.path.exists(userdir):
-                os.makedirs(userdir, 0700)
+                os.makedirs(userdir, 0o700)
 
         try:
             with open(self.config_file(user)) as f:
diff --git a/Allura/ldap-setup.py b/Allura/ldap-setup.py
index 07dbe29..600c547 100644
--- a/Allura/ldap-setup.py
+++ b/Allura/ldap-setup.py
@@ -56,7 +56,7 @@ def main():
             run('ldapadd -Y EXTERNAL -H ldapi:/// -f %s' % name)
     with open('/etc/ldap.secret', 'w') as fp:
         fp.write(secret)
-    os.chmod('/etc/ldap.secret', 0400)
+    os.chmod('/etc/ldap.secret', 0o400)
     if get_value('add frontend ldif', 'y') == 'y':
         with tempfile(frontend_ldif, locals()) as name:
             run('ldapadd -c -x -D cn=admin,%s -W -f %s -y /etc/ldap.secret' %
@@ -77,7 +77,7 @@ def main():
         log.info('writing passwd')
         with open('/etc/ldapscripts/ldapscripts.passwd', 'w') as fp:
             fp.write(secret)
-        os.chmod('/etc/ldapscripts/ldapscripts.passwd', 0400)
+        os.chmod('/etc/ldapscripts/ldapscripts.passwd', 0o400)
         log.info('writing runtime')
         with open('/usr/share/ldapscripts/runtime.debian', 'w') as fp:
             fp.write(ldapscripts_debian)
diff --git a/Allura/ldap-userconfig.py b/Allura/ldap-userconfig.py
index c0f2330..4e29a60 100644
--- a/Allura/ldap-userconfig.py
+++ b/Allura/ldap-userconfig.py
@@ -39,8 +39,8 @@ def init(uname):
     os.mkdir(ssh)
     u = pwd.getpwnam(uname)
     g = grp.getgrnam('scm')
-    os.chmod(home, 0700)
-    os.chmod(ssh, 0700)
+    os.chmod(home, 0o700)
+    os.chmod(ssh, 0o700)
     os.chown(home, u.pw_uid, g.gr_gid)
     os.chown(ssh, u.pw_uid, g.gr_gid)
 
@@ -52,7 +52,7 @@ def upload(uname, pubkey):
     with open(keyfile, 'w') as fp:
         fp.write(pubkey)
     os.chown(keyfile, u.pw_uid, g.gr_gid)
-    os.chmod(keyfile, 0600)
+    os.chmod(keyfile, 0o600)
 
 if __name__ == '__main__':
     main()
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 2c01380..513b0cc 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -487,7 +487,7 @@ class GitImplementation(M.RepositoryImplementation):
                           'hooks', 'post-receive')
         with open(fn, 'w') as fp:
             fp.write(text)
-        os.chmod(fn, 0755)
+        os.chmod(fn, 0o755)
 
     def _object(self, oid):
         evens = oid[::2]
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 7bf084b..c91c1f9 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -236,7 +236,7 @@ class SVNImplementation(M.RepositoryImplementation):
                               'hooks', hook_name)
             with open(fn, 'wb') as fp:
                 fp.write('#!/bin/sh\n')
-            os.chmod(fn, 0755)
+            os.chmod(fn, 0o755)
 
         def clear_hook(hook_name):
             fn = os.path.join(self._repo.fs_path, self._repo.name,
@@ -611,7 +611,7 @@ class SVNImplementation(M.RepositoryImplementation):
                           'hooks', 'post-commit')
         with open(fn, 'wb') as fp:
             fp.write(text)
-        os.chmod(fn, 0755)
+        os.chmod(fn, 0o755)
 
     def _revno(self, oid):
         return int(oid.split(':')[1])