From 1ec736038c7024214f1c60dfdb9a8d628707dbba Mon Sep 17 00:00:00 2001 From: Carlos Meza Date: Mon, 9 Apr 2018 22:25:58 -0700 Subject: [PATCH] pylint E1608(old-octal-literal) --- bootstrapvz/common/tasks/apt.py | 4 ++-- bootstrapvz/common/tasks/ssh.py | 2 +- bootstrapvz/plugins/admin_user/tasks.py | 2 +- bootstrapvz/plugins/cloud_init/tasks.py | 2 +- bootstrapvz/plugins/docker_daemon/tasks.py | 2 +- bootstrapvz/plugins/expand_root/tasks.py | 2 +- bootstrapvz/plugins/minimize_size/tasks/dpkg.py | 2 +- bootstrapvz/plugins/minimize_size/tasks/shrink.py | 2 +- bootstrapvz/providers/ec2/tasks/boot.py | 2 +- bootstrapvz/providers/ec2/tasks/network.py | 4 ++-- bootstrapvz/providers/ec2/tasks/tuning.py | 2 +- bootstrapvz/providers/kvm/tasks/boot.py | 2 +- pylintrc | 3 +-- 13 files changed, 15 insertions(+), 16 deletions(-) diff --git a/bootstrapvz/common/tasks/apt.py b/bootstrapvz/common/tasks/apt.py index e7bf458..1ef2977 100644 --- a/bootstrapvz/common/tasks/apt.py +++ b/bootstrapvz/common/tasks/apt.py @@ -180,12 +180,12 @@ class DisableDaemonAutostart(Task): with open(rc_policy_path, 'w') as rc_policy: rc_policy.write(('#!/bin/sh\n' 'exit 101')) - os.chmod(rc_policy_path, 0755) + os.chmod(rc_policy_path, 0o755) initictl_path = os.path.join(info.root, 'sbin/initctl') with open(initictl_path, 'w') as initctl: initctl.write(('#!/bin/sh\n' 'exit 0')) - os.chmod(initictl_path, 0755) + os.chmod(initictl_path, 0o755) class AptUpdate(Task): diff --git a/bootstrapvz/common/tasks/ssh.py b/bootstrapvz/common/tasks/ssh.py index 46addaf..05c7358 100644 --- a/bootstrapvz/common/tasks/ssh.py +++ b/bootstrapvz/common/tasks/ssh.py @@ -49,7 +49,7 @@ class AddSSHKeyGeneration(Task): shutil.copy(ssh_keygen_host_service, ssh_keygen_host_service_dest) shutil.copy(ssh_keygen_host_script, ssh_keygen_host_script_dest) - os.chmod(ssh_keygen_host_script_dest, 0750) + os.chmod(ssh_keygen_host_script_dest, 0o750) # Enable systemd service log_check_call(['chroot', info.root, 'systemctl', 'enable', 'ssh-generate-hostkeys.service']) diff --git a/bootstrapvz/plugins/admin_user/tasks.py b/bootstrapvz/plugins/admin_user/tasks.py index 9ba33bf..a1bb302 100644 --- a/bootstrapvz/plugins/admin_user/tasks.py +++ b/bootstrapvz/plugins/admin_user/tasks.py @@ -112,7 +112,7 @@ class AdminUserPublicKey(Task): # Create the ssh dir if nobody has created it yet if not os.path.exists(ssh_dir_abs): - os.mkdir(ssh_dir_abs, 0700) + os.mkdir(ssh_dir_abs, 0o700) # Create (or append to) the authorized keys file (and chmod u=rw,go=) import stat diff --git a/bootstrapvz/plugins/cloud_init/tasks.py b/bootstrapvz/plugins/cloud_init/tasks.py index 85f0d1c..9504cf9 100644 --- a/bootstrapvz/plugins/cloud_init/tasks.py +++ b/bootstrapvz/plugins/cloud_init/tasks.py @@ -136,4 +136,4 @@ class SetCloudInitMountOptions(Task): cloud_init_src = os.path.join(assets, 'cloud-init/debian_cloud.cfg') cloud_init_dst = os.path.join(info.root, 'etc/cloud/cloud.cfg.d/01_debian_cloud.cfg') copy(cloud_init_src, cloud_init_dst) - os.chmod(cloud_init_dst, 0644) + os.chmod(cloud_init_dst, 0o644) diff --git a/bootstrapvz/plugins/docker_daemon/tasks.py b/bootstrapvz/plugins/docker_daemon/tasks.py index bdbfc1b..f207794 100644 --- a/bootstrapvz/plugins/docker_daemon/tasks.py +++ b/bootstrapvz/plugins/docker_daemon/tasks.py @@ -38,7 +38,7 @@ class AddDockerBinary(Task): docker_url += 'latest' bin_docker = os.path.join(info.root, 'usr/bin/docker') log_check_call(['wget', '-O', bin_docker, docker_url]) - os.chmod(bin_docker, 0755) + os.chmod(bin_docker, 0o755) class AddDockerInit(Task): diff --git a/bootstrapvz/plugins/expand_root/tasks.py b/bootstrapvz/plugins/expand_root/tasks.py index ede2acf..08ab937 100644 --- a/bootstrapvz/plugins/expand_root/tasks.py +++ b/bootstrapvz/plugins/expand_root/tasks.py @@ -46,7 +46,7 @@ class InstallExpandRootScripts(Task): # Copy files over shutil.copy(expand_root_script, expand_root_script_dest) - os.chmod(expand_root_script_dest, 0750) + os.chmod(expand_root_script_dest, 0o750) shutil.copy(expand_root_service, expand_root_service_dest) # Expand out options into expand-root script. diff --git a/bootstrapvz/plugins/minimize_size/tasks/dpkg.py b/bootstrapvz/plugins/minimize_size/tasks/dpkg.py index 73d2aa6..48b2f3e 100644 --- a/bootstrapvz/plugins/minimize_size/tasks/dpkg.py +++ b/bootstrapvz/plugins/minimize_size/tasks/dpkg.py @@ -48,7 +48,7 @@ class CreateBootstrapFilterScripts(Task): include_list = '\n'.join(map(lambda p: '.' + p, filter_lists['include'])) sed_i(filter_script, r'EXCLUDE_PATTERN', exclude_list) sed_i(filter_script, r'INCLUDE_PATHS', include_list) - os.chmod(filter_script, 0755) + os.chmod(filter_script, 0o755) info.bootstrap_script = bootstrap_script info._minimize_size['filter_script'] = filter_script diff --git a/bootstrapvz/plugins/minimize_size/tasks/shrink.py b/bootstrapvz/plugins/minimize_size/tasks/shrink.py index de1fc0c..c58eccd 100644 --- a/bootstrapvz/plugins/minimize_size/tasks/shrink.py +++ b/bootstrapvz/plugins/minimize_size/tasks/shrink.py @@ -57,7 +57,7 @@ class ShrinkVolumeWithVDiskManager(Task): @classmethod def run(cls, info): - perm = os.stat(info.volume.image_path).st_mode & 0777 + perm = os.stat(info.volume.image_path).st_mode & 0o777 log_check_call(['/usr/bin/vmware-vdiskmanager', '-k', info.volume.image_path]) os.chmod(info.volume.image_path, perm) diff --git a/bootstrapvz/providers/ec2/tasks/boot.py b/bootstrapvz/providers/ec2/tasks/boot.py index 7163fb8..15426a5 100644 --- a/bootstrapvz/providers/ec2/tasks/boot.py +++ b/bootstrapvz/providers/ec2/tasks/boot.py @@ -44,7 +44,7 @@ class CreatePVGrubCustomRule(Task): script_src = os.path.join(assets, 'grub.d/40_custom') script_dst = os.path.join(info.root, 'etc/grub.d/40_custom') copy(script_src, script_dst) - os.chmod(script_dst, 0755) + os.chmod(script_dst, 0o755) from bootstrapvz.base.fs.partitionmaps.none import NoPartitions if not isinstance(info.volume.partition_map, NoPartitions): diff --git a/bootstrapvz/providers/ec2/tasks/network.py b/bootstrapvz/providers/ec2/tasks/network.py index ae05f9a..eb8894f 100644 --- a/bootstrapvz/providers/ec2/tasks/network.py +++ b/bootstrapvz/providers/ec2/tasks/network.py @@ -56,8 +56,8 @@ class InstallNetworkingUDevHotplugAndDHCPSubinterface(Task): os.path.join(script_dst, 'udev/rules.d/53-ec2-network-interfaces.rules')) os.chmod(os.path.join(script_dst, 'udev/rules.d/53-ec2-network-interfaces.rules'), rwxr_xr_x) - os.mkdir(os.path.join(script_dst, 'sysconfig'), 0755) - os.mkdir(os.path.join(script_dst, 'sysconfig/network-scripts'), 0755) + os.mkdir(os.path.join(script_dst, 'sysconfig'), 0o755) + os.mkdir(os.path.join(script_dst, 'sysconfig/network-scripts'), 0o755) copy(os.path.join(script_src, 'ec2net.hotplug'), os.path.join(script_dst, 'sysconfig/network-scripts/ec2net.hotplug')) os.chmod(os.path.join(script_dst, 'sysconfig/network-scripts/ec2net.hotplug'), rwxr_xr_x) diff --git a/bootstrapvz/providers/ec2/tasks/tuning.py b/bootstrapvz/providers/ec2/tasks/tuning.py index ddfa1c9..8a007ae 100644 --- a/bootstrapvz/providers/ec2/tasks/tuning.py +++ b/bootstrapvz/providers/ec2/tasks/tuning.py @@ -14,7 +14,7 @@ class TuneSystem(Task): sysctl_src = os.path.join(assets, 'sysctl.d/tuning.conf') sysctl_dst = os.path.join(info.root, 'etc/sysctl.d/01_ec2.conf') copy(sysctl_src, sysctl_dst) - os.chmod(sysctl_dst, 0644) + os.chmod(sysctl_dst, 0o644) class BlackListModules(Task): diff --git a/bootstrapvz/providers/kvm/tasks/boot.py b/bootstrapvz/providers/kvm/tasks/boot.py index 123d2e3..6064580 100644 --- a/bootstrapvz/providers/kvm/tasks/boot.py +++ b/bootstrapvz/providers/kvm/tasks/boot.py @@ -39,5 +39,5 @@ class SetSystemdTTYVTDisallocate(Task): src = os.path.join(assets, 'noclear.conf') dst_dir = os.path.join(info.root, 'etc/systemd/system/getty@tty1.service.d') dst = os.path.join(dst_dir, 'noclear.conf') - os.mkdir(dst_dir, 0755) + os.mkdir(dst_dir, 0o755) copy(src, dst) diff --git a/pylintrc b/pylintrc index f219b38..3177adf 100644 --- a/pylintrc +++ b/pylintrc @@ -32,7 +32,7 @@ enable= # Disable the message, report, category or checker with the given id(s). You # can either give multiple identifier separated by comma (,) or put this option # multiple time. -disable=W0511,C0111,I0011,I0020,R0201,R0801,E0632,E1121,E1608,W0102,W0106,W0108,W0110,W0201,W0212,W0311,W0402,W0612,W0613,W0640,W1201,W1202,W1401,C0103,C0301,C0325,C0326,C0330,C0411,R0401,R0914,R1710 +disable=W0511,C0111,I0011,I0020,R0201,R0801,E0632,E1121,W0102,W0106,W0108,W0110,W0201,W0212,W0311,W0402,W0612,W0613,W0640,W1201,W1202,W1401,C0103,C0301,C0325,C0326,C0330,C0411,R0401,R0914,R1710 # W0511 fixme # C0111 missing-docstring # I0011 locally-disabled @@ -42,7 +42,6 @@ disable=W0511,C0111,I0011,I0020,R0201,R0801,E0632,E1121,E1608,W0102,W0106,W0108, #TODO # E0632(unbalanced-tuple-unpacking) # E1121(too-many-function-args) -# E1608(old-octal-literal) # W0102(dangerous-default-value) # W0106(expression-not-assigned) # W0108(unnecessary-lambda)