Skip to content

Commit

Permalink
pylint E1608(old-octal-literal)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Meza committed Apr 10, 2018
1 parent 43e54d2 commit 1ec7360
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions bootstrapvz/common/tasks/apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ def run(cls, info):
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):
Expand Down
2 changes: 1 addition & 1 deletion bootstrapvz/common/tasks/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def run(cls, info):
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'])
Expand Down
2 changes: 1 addition & 1 deletion bootstrapvz/plugins/admin_user/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def run(cls, info):

# 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
Expand Down
2 changes: 1 addition & 1 deletion bootstrapvz/plugins/cloud_init/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ def run(cls, info):
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)
2 changes: 1 addition & 1 deletion bootstrapvz/plugins/docker_daemon/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run(cls, info):
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):
Expand Down
2 changes: 1 addition & 1 deletion bootstrapvz/plugins/expand_root/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def run(cls, info):

# 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.
Expand Down
2 changes: 1 addition & 1 deletion bootstrapvz/plugins/minimize_size/tasks/dpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def run(cls, info):
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
Expand Down
2 changes: 1 addition & 1 deletion bootstrapvz/plugins/minimize_size/tasks/shrink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion bootstrapvz/providers/ec2/tasks/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def run(cls, info):
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):
Expand Down
4 changes: 2 additions & 2 deletions bootstrapvz/providers/ec2/tasks/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def run(cls, info):
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)
Expand Down
2 changes: 1 addition & 1 deletion bootstrapvz/providers/ec2/tasks/tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def run(cls, info):
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):
Expand Down
2 changes: 1 addition & 1 deletion bootstrapvz/providers/kvm/tasks/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ def run(cls, info):
src = os.path.join(assets, 'noclear.conf')
dst_dir = os.path.join(info.root, 'etc/systemd/system/[email protected]')
dst = os.path.join(dst_dir, 'noclear.conf')
os.mkdir(dst_dir, 0755)
os.mkdir(dst_dir, 0o755)
copy(src, dst)
3 changes: 1 addition & 2 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 1ec7360

Please sign in to comment.