diff --git a/bootstrapvz/common/tools.py b/bootstrapvz/common/tools.py index c14f67a..9fdceb8 100644 --- a/bootstrapvz/common/tools.py +++ b/bootstrapvz/common/tools.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os @@ -82,7 +83,7 @@ def inline_replace(file_path, pattern, subst): for line in fileinput.input(files=file_path, inplace=True): (replacement, count) = re.subn(pattern, subst, line) replacement_count += count - print replacement, + print(replacement, end=' ') return replacement_count diff --git a/bootstrapvz/plugins/cloud_init/tasks.py b/bootstrapvz/plugins/cloud_init/tasks.py index 57ffa06..85f0d1c 100644 --- a/bootstrapvz/plugins/cloud_init/tasks.py +++ b/bootstrapvz/plugins/cloud_init/tasks.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from bootstrapvz.base import Task from bootstrapvz.common import phases from bootstrapvz.common.tools import log_check_call @@ -98,7 +100,7 @@ class DisableModules(Task): import fileinput for line in fileinput.input(files=cloud_cfg, inplace=True): if not regex.match(line): - print line, + print(line, end=' ') class EnableModules(Task): @@ -122,7 +124,7 @@ class EnableModules(Task): count = count + 1 if int(entry['position']) == int(count): print(" - %s" % entry['module']) - print line, + print(line, end=' ') class SetCloudInitMountOptions(Task): diff --git a/bootstrapvz/plugins/ntp/tasks.py b/bootstrapvz/plugins/ntp/tasks.py index 126ba9f..5e8e674 100644 --- a/bootstrapvz/plugins/ntp/tasks.py +++ b/bootstrapvz/plugins/ntp/tasks.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from bootstrapvz.base import Task from bootstrapvz.common import phases @@ -27,6 +29,6 @@ class SetNtpServers(Task): # Will write all the specified servers on the first match, then supress all other default servers if re.match(debian_ntp_server, line): while servers: - print 'server {server_address} iburst'.format(server_address=servers.pop(0)) + print('server {server_address} iburst'.format(server_address=servers.pop(0))) else: - print line, + print(line, end=' ') diff --git a/pylintrc b/pylintrc index 11e90bc..f219b38 100644 --- a/pylintrc +++ b/pylintrc @@ -27,14 +27,14 @@ load-plugins= # Enable 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. -enable=W0401,W0403,W0404,W0406,W0611,W0614 +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,E1601,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,E1608,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 mssing-docstring +# C0111 missing-docstring # I0011 locally-disabled # I0020 suppressed-message # R0801 duplicate-code @@ -42,7 +42,6 @@ disable=W0511,C0111,I0011,I0020,R0201,R0801,E0632,E1121,E1601,E1608,W0102,W0106, #TODO # E0632(unbalanced-tuple-unpacking) # E1121(too-many-function-args) -# E1601(print-statement) # E1608(old-octal-literal) # W0102(dangerous-default-value) # W0106(expression-not-assigned) diff --git a/tests/system/docker_tests.py b/tests/system/docker_tests.py index 9aa30dd..c56c279 100644 --- a/tests/system/docker_tests.py +++ b/tests/system/docker_tests.py @@ -26,4 +26,4 @@ def test_stable(): custom_partials = [partials['docker']] manifest_data = merge_manifest_data(std_partials, custom_partials) with boot_manifest(manifest_data) as instance: - print('\n'.join(instance.run(['echo', 'test']))) + print('\n'.join(instance.run(['echo', 'test']))) # pylint: disable=print-statement diff --git a/tests/system/ec2_ebs_hvm_tests.py b/tests/system/ec2_ebs_hvm_tests.py index ebd2c8e..e041ac0 100644 --- a/tests/system/ec2_ebs_hvm_tests.py +++ b/tests/system/ec2_ebs_hvm_tests.py @@ -1,6 +1,8 @@ from .manifests import merge_manifest_data from .tools import boot_manifest +# pylint: disable=print-statement + partials = {'ebs_hvm': ''' provider: name: ec2 diff --git a/tests/system/ec2_ebs_pvm_tests.py b/tests/system/ec2_ebs_pvm_tests.py index 56e2d37..9ad458e 100644 --- a/tests/system/ec2_ebs_pvm_tests.py +++ b/tests/system/ec2_ebs_pvm_tests.py @@ -1,6 +1,8 @@ from .manifests import merge_manifest_data from .tools import boot_manifest +# pylint: disable=print-statement + partials = {'ebs_pvm': ''' provider: name: ec2 diff --git a/tests/system/ec2_s3_pvm_tests.py b/tests/system/ec2_s3_pvm_tests.py index 7389123..fdb3f10 100644 --- a/tests/system/ec2_s3_pvm_tests.py +++ b/tests/system/ec2_s3_pvm_tests.py @@ -2,6 +2,8 @@ from .manifests import merge_manifest_data from .tools import boot_manifest import random +# pylint: disable=print-statement + s3_bucket_name = '{id:x}'.format(id=random.randrange(16 ** 16)) partials = {'s3_pvm': ''' provider: diff --git a/tests/system/virtualbox_tests.py b/tests/system/virtualbox_tests.py index 87cf6b4..f1ed5e7 100644 --- a/tests/system/virtualbox_tests.py +++ b/tests/system/virtualbox_tests.py @@ -1,6 +1,8 @@ from .manifests import merge_manifest_data from .tools import boot_manifest +# pylint: disable=print-statement + partials = {'vdi': '{provider: {name: virtualbox}, volume: {backing: vdi}}', 'vmdk': '{provider: {name: virtualbox}, volume: {backing: vmdk}}', }