pylint E1608(old-octal-literal)

This commit is contained in:
Carlos Meza 2018-04-09 22:25:58 -07:00
parent 43e54d26cc
commit 1ec736038c
13 changed files with 15 additions and 16 deletions

View file

@ -180,12 +180,12 @@ class DisableDaemonAutostart(Task):
with open(rc_policy_path, 'w') as rc_policy: with open(rc_policy_path, 'w') as rc_policy:
rc_policy.write(('#!/bin/sh\n' rc_policy.write(('#!/bin/sh\n'
'exit 101')) 'exit 101'))
os.chmod(rc_policy_path, 0755) os.chmod(rc_policy_path, 0o755)
initictl_path = os.path.join(info.root, 'sbin/initctl') initictl_path = os.path.join(info.root, 'sbin/initctl')
with open(initictl_path, 'w') as initctl: with open(initictl_path, 'w') as initctl:
initctl.write(('#!/bin/sh\n' initctl.write(('#!/bin/sh\n'
'exit 0')) 'exit 0'))
os.chmod(initictl_path, 0755) os.chmod(initictl_path, 0o755)
class AptUpdate(Task): class AptUpdate(Task):

View file

@ -49,7 +49,7 @@ class AddSSHKeyGeneration(Task):
shutil.copy(ssh_keygen_host_service, ssh_keygen_host_service_dest) shutil.copy(ssh_keygen_host_service, ssh_keygen_host_service_dest)
shutil.copy(ssh_keygen_host_script, ssh_keygen_host_script_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 # Enable systemd service
log_check_call(['chroot', info.root, 'systemctl', 'enable', 'ssh-generate-hostkeys.service']) log_check_call(['chroot', info.root, 'systemctl', 'enable', 'ssh-generate-hostkeys.service'])

View file

@ -112,7 +112,7 @@ class AdminUserPublicKey(Task):
# Create the ssh dir if nobody has created it yet # Create the ssh dir if nobody has created it yet
if not os.path.exists(ssh_dir_abs): 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=) # Create (or append to) the authorized keys file (and chmod u=rw,go=)
import stat import stat

View file

@ -136,4 +136,4 @@ class SetCloudInitMountOptions(Task):
cloud_init_src = os.path.join(assets, 'cloud-init/debian_cloud.cfg') 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') cloud_init_dst = os.path.join(info.root, 'etc/cloud/cloud.cfg.d/01_debian_cloud.cfg')
copy(cloud_init_src, cloud_init_dst) copy(cloud_init_src, cloud_init_dst)
os.chmod(cloud_init_dst, 0644) os.chmod(cloud_init_dst, 0o644)

View file

@ -38,7 +38,7 @@ class AddDockerBinary(Task):
docker_url += 'latest' docker_url += 'latest'
bin_docker = os.path.join(info.root, 'usr/bin/docker') bin_docker = os.path.join(info.root, 'usr/bin/docker')
log_check_call(['wget', '-O', bin_docker, docker_url]) log_check_call(['wget', '-O', bin_docker, docker_url])
os.chmod(bin_docker, 0755) os.chmod(bin_docker, 0o755)
class AddDockerInit(Task): class AddDockerInit(Task):

View file

@ -46,7 +46,7 @@ class InstallExpandRootScripts(Task):
# Copy files over # Copy files over
shutil.copy(expand_root_script, expand_root_script_dest) 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) shutil.copy(expand_root_service, expand_root_service_dest)
# Expand out options into expand-root script. # Expand out options into expand-root script.

View file

@ -48,7 +48,7 @@ class CreateBootstrapFilterScripts(Task):
include_list = '\n'.join(map(lambda p: '.' + p, filter_lists['include'])) 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'EXCLUDE_PATTERN', exclude_list)
sed_i(filter_script, r'INCLUDE_PATHS', include_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.bootstrap_script = bootstrap_script
info._minimize_size['filter_script'] = filter_script info._minimize_size['filter_script'] = filter_script

View file

@ -57,7 +57,7 @@ class ShrinkVolumeWithVDiskManager(Task):
@classmethod @classmethod
def run(cls, info): 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]) log_check_call(['/usr/bin/vmware-vdiskmanager', '-k', info.volume.image_path])
os.chmod(info.volume.image_path, perm) os.chmod(info.volume.image_path, perm)

View file

@ -44,7 +44,7 @@ class CreatePVGrubCustomRule(Task):
script_src = os.path.join(assets, 'grub.d/40_custom') script_src = os.path.join(assets, 'grub.d/40_custom')
script_dst = os.path.join(info.root, 'etc/grub.d/40_custom') script_dst = os.path.join(info.root, 'etc/grub.d/40_custom')
copy(script_src, script_dst) copy(script_src, script_dst)
os.chmod(script_dst, 0755) os.chmod(script_dst, 0o755)
from bootstrapvz.base.fs.partitionmaps.none import NoPartitions from bootstrapvz.base.fs.partitionmaps.none import NoPartitions
if not isinstance(info.volume.partition_map, NoPartitions): if not isinstance(info.volume.partition_map, NoPartitions):

View file

@ -56,8 +56,8 @@ class InstallNetworkingUDevHotplugAndDHCPSubinterface(Task):
os.path.join(script_dst, 'udev/rules.d/53-ec2-network-interfaces.rules')) 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.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'), 0o755)
os.mkdir(os.path.join(script_dst, 'sysconfig/network-scripts'), 0755) os.mkdir(os.path.join(script_dst, 'sysconfig/network-scripts'), 0o755)
copy(os.path.join(script_src, 'ec2net.hotplug'), copy(os.path.join(script_src, 'ec2net.hotplug'),
os.path.join(script_dst, 'sysconfig/network-scripts/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) os.chmod(os.path.join(script_dst, 'sysconfig/network-scripts/ec2net.hotplug'), rwxr_xr_x)

View file

@ -14,7 +14,7 @@ class TuneSystem(Task):
sysctl_src = os.path.join(assets, 'sysctl.d/tuning.conf') sysctl_src = os.path.join(assets, 'sysctl.d/tuning.conf')
sysctl_dst = os.path.join(info.root, 'etc/sysctl.d/01_ec2.conf') sysctl_dst = os.path.join(info.root, 'etc/sysctl.d/01_ec2.conf')
copy(sysctl_src, sysctl_dst) copy(sysctl_src, sysctl_dst)
os.chmod(sysctl_dst, 0644) os.chmod(sysctl_dst, 0o644)
class BlackListModules(Task): class BlackListModules(Task):

View file

@ -39,5 +39,5 @@ class SetSystemdTTYVTDisallocate(Task):
src = os.path.join(assets, 'noclear.conf') src = os.path.join(assets, 'noclear.conf')
dst_dir = os.path.join(info.root, 'etc/systemd/system/getty@tty1.service.d') dst_dir = os.path.join(info.root, 'etc/systemd/system/getty@tty1.service.d')
dst = os.path.join(dst_dir, 'noclear.conf') dst = os.path.join(dst_dir, 'noclear.conf')
os.mkdir(dst_dir, 0755) os.mkdir(dst_dir, 0o755)
copy(src, dst) copy(src, dst)

View file

@ -32,7 +32,7 @@ enable=
# Disable the message, report, category or checker with the given id(s). You # 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 # can either give multiple identifier separated by comma (,) or put this option
# multiple time. # 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 # W0511 fixme
# C0111 missing-docstring # C0111 missing-docstring
# I0011 locally-disabled # I0011 locally-disabled
@ -42,7 +42,6 @@ disable=W0511,C0111,I0011,I0020,R0201,R0801,E0632,E1121,E1608,W0102,W0106,W0108,
#TODO #TODO
# E0632(unbalanced-tuple-unpacking) # E0632(unbalanced-tuple-unpacking)
# E1121(too-many-function-args) # E1121(too-many-function-args)
# E1608(old-octal-literal)
# W0102(dangerous-default-value) # W0102(dangerous-default-value)
# W0106(expression-not-assigned) # W0106(expression-not-assigned)
# W0108(unnecessary-lambda) # W0108(unnecessary-lambda)