PY3: fix some octal literals
authorNoel Power <noel.power@suse.com>
Fri, 27 Jul 2018 13:35:16 +0000 (14:35 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 16 Sep 2018 04:16:19 +0000 (06:16 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/wafsamba.py
ctdb/wscript

index 36bc6c36483a5cc8c41844d158916e3dc9f46e2f..59a4eacb305bc2f92e4639f5165bd5c0bb8e505c 100644 (file)
@@ -795,7 +795,7 @@ sys.path.insert(1, "%s")""" % (task.env["PYTHONARCHDIR"], task.env["PYTHONDIR"])
         installed_file.write(newline)
         lineno = lineno + 1
     installed_file.close()
-    os.chmod(installed_location, 0755)
+    os.chmod(installed_location, 0o755)
     return 0
 
 def copy_and_fix_perl_path(task):
@@ -823,7 +823,7 @@ def copy_and_fix_perl_path(task):
         installed_file.write(newline)
         lineno = lineno + 1
     installed_file.close()
-    os.chmod(installed_location, 0755)
+    os.chmod(installed_location, 0o755)
     return 0
 
 
index 6d4fee597c0f96bcf005e313f08d6dcbc65a97f1..e2e964a397fd411091874148225ecfa10a9e080a 100644 (file)
@@ -736,14 +736,14 @@ def build(bld):
                         target='onnode',
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES('${BINDIR}', 'onnode',
-                      destname='onnode', chmod=0755)
+                      destname='onnode', chmod=0o755)
 
     bld.SAMBA_GENERATOR('ctdb-diagnostics',
                         source='tools/ctdb_diagnostics',
                         target='ctdb_diagnostics',
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES('${BINDIR}', 'ctdb_diagnostics',
-                      destname='ctdb_diagnostics', chmod=0755)
+                      destname='ctdb_diagnostics', chmod=0o755)
 
     if bld.env.etcd_reclock:
         bld.SAMBA_GENERATOR('ctdb-etcd-lock',
@@ -751,35 +751,35 @@ def build(bld):
                             target='ctdb_etcd_lock',
                             rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
         bld.INSTALL_FILES('${CTDB_HELPER_BINDIR}', 'ctdb_etcd_lock',
-                          destname='ctdb_etcd_lock', chmod=0744)
+                          destname='ctdb_etcd_lock', chmod=0o744)
 
     bld.SAMBA_GENERATOR('ctdb-natgw',
                         source='tools/ctdb_natgw',
                         target='ctdb_natgw',
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES('${CTDB_HELPER_BINDIR}', 'ctdb_natgw',
-                      destname='ctdb_natgw', chmod=0755)
+                      destname='ctdb_natgw', chmod=0o755)
 
     bld.SAMBA_GENERATOR('ctdb-lvs',
                         source='tools/ctdb_lvs',
                         target='ctdb_lvs',
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES('${CTDB_HELPER_BINDIR}', 'ctdb_lvs',
-                      destname='ctdb_lvs', chmod=0755)
+                      destname='ctdb_lvs', chmod=0o755)
 
     bld.SAMBA_GENERATOR('ctdbd-wrapper',
                         source='config/ctdbd_wrapper',
                         target='ctdbd_wrapper',
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES('${SBINDIR}', 'ctdbd_wrapper',
-                      destname='ctdbd_wrapper', chmod=0755)
+                      destname='ctdbd_wrapper', chmod=0o755)
 
     def SUBDIR_MODE_callback(arg, dirname, fnames):
         for f in fnames:
             fl = os.path.join(dirname, f)
             if os.path.isdir(fl) or os.path.islink(fl):
                 continue
-            mode = os.lstat(fl).st_mode & 0777
+            mode = os.lstat(fl).st_mode & 0o777
             if arg['trim_path']:
                 fl = samba_utils.os_path_relpath(fl, arg['trim_path'])
             arg['file_list'].append([fl, mode])
@@ -851,7 +851,7 @@ def build(bld):
 
     for t in etc_scripts:
         bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/%s' % t,
-                          destname=t, chmod=0755)
+                          destname=t, chmod=0o755)
 
     bld.SAMBA_GENERATOR('ctdb-sudoers',
                         source='config/ctdb.sudoers',
@@ -1091,7 +1091,7 @@ def build(bld):
                         target='test_wrap',
                         rule='sed -e "%s" ${SRC} > ${TGT}' % sed_expr)
     bld.INSTALL_FILES(bld.env.CTDB_TEST_DATADIR+"/scripts", 'test_wrap',
-                      destname='test_wrap', chmod=0755)
+                      destname='test_wrap', chmod=0o755)
 
     bld.SAMBA_GENERATOR('ctdb-test-script-install-paths',
                         source='tests/scripts/script_install_paths.sh',
@@ -1099,7 +1099,7 @@ def build(bld):
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES(bld.env.CTDB_TEST_DATADIR+"/scripts",
                       'script_install_paths.sh',
-                      destname='script_install_paths.sh', chmod=0644)
+                      destname='script_install_paths.sh', chmod=0o644)
 
     sed_expr1 = 's@^\(export %s\)=.*@\\1=%s\\nexport %s=\"%s\"@''' % (
                     'CTDB_TEST_DIR', bld.env.CTDB_TEST_DATADIR,
@@ -1111,7 +1111,7 @@ def build(bld):
                         rule='sed -e "%s" -e "%s" ${SRC} > ${TGT}' % (
                              sed_expr1, sed_expr2))
     bld.INSTALL_FILES('${BINDIR}', 'ctdb_run_tests.sh',
-                      destname='ctdb_run_tests', chmod=0755)
+                      destname='ctdb_run_tests', chmod=0o755)
     bld.symlink_as(os.path.join(bld.env.BINDIR, 'ctdb_run_cluster_tests'),
                    'ctdb_run_tests')