diff --git a/molecule/default/roles/k8scopy/library/k8s_create_file.py b/molecule/default/roles/k8scopy/library/k8s_create_file.py index 5e464172..7160e205 100644 --- a/molecule/default/roles/k8scopy/library/k8s_create_file.py +++ b/molecule/default/roles/k8scopy/library/k8s_create_file.py @@ -67,7 +67,7 @@ def execute_module(module): content = "" count = 0 while len(content) < size: - content += f"This file has been generated using ansible: {count}\n" + content += "This file has been generated using ansible: {0}\n".format(count) count += 1 with open(path, write_mode) as f: diff --git a/molecule/default/roles/k8scopy/library/kubectl_file_compare.py b/molecule/default/roles/k8scopy/library/kubectl_file_compare.py index 530d038e..2487febd 100644 --- a/molecule/default/roles/k8scopy/library/kubectl_file_compare.py +++ b/molecule/default/roles/k8scopy/library/kubectl_file_compare.py @@ -166,7 +166,9 @@ def execute_module(module): pod_rc, pod_out, pod_err = kubectl_run_from_pod(module) rc, out, err = module.run_command([module.params.get('local_path')] + args) if rc == pod_rc and out == pod_out: - module.exit_json(msg=f"{local_path} and {namespace}/{pod}:{file} are same.", rc=rc, stderr=err, stdout=out) + module.exit_json(msg="{0} and {1}/{2}:{3} are same.".format( + local_path, namespace, pod, file + ), rc=rc, stderr=err, stdout=out) result = dict(local=dict(rc=rc, out=out, err=err), remote=dict(rc=pod_rc, out=pod_out, err=pod_err)) module.fail_json(msg=f"{local_path} and {namespace}/{pod}:{file} are same.", **result) else: diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index aa5c00b2..d0c179e5 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -234,3 +234,10 @@ tests/unit/module_utils/test_discoverer.py future-import-boilerplate!skip tests/unit/module_utils/test_discoverer.py metaclass-boilerplate!skip molecule/default/roles/k8scopy/library/kubectl_file_compare.py shebang molecule/default/roles/k8scopy/library/k8s_create_file.py shebang +plugins/modules/k8s_cp.py compile-2.6!skip +plugins/modules/k8s_cp.py compile-2.7!skip +plugins/modules/k8s_cp.py import-2.6!skip +plugins/modules/k8s_cp.py import-2.7!skip +molecule/default/roles/k8scopy/library/kubectl_file_compare.py compile-2.6!skip +molecule/default/roles/k8scopy/library/kubectl_file_compare.py compile-2.7!skip +molecule/default/roles/k8scopy/library/kubectl_file_compare.py compile-3.5!skip \ No newline at end of file diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index aa5c00b2..d0c179e5 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -234,3 +234,10 @@ tests/unit/module_utils/test_discoverer.py future-import-boilerplate!skip tests/unit/module_utils/test_discoverer.py metaclass-boilerplate!skip molecule/default/roles/k8scopy/library/kubectl_file_compare.py shebang molecule/default/roles/k8scopy/library/k8s_create_file.py shebang +plugins/modules/k8s_cp.py compile-2.6!skip +plugins/modules/k8s_cp.py compile-2.7!skip +plugins/modules/k8s_cp.py import-2.6!skip +plugins/modules/k8s_cp.py import-2.7!skip +molecule/default/roles/k8scopy/library/kubectl_file_compare.py compile-2.6!skip +molecule/default/roles/k8scopy/library/kubectl_file_compare.py compile-2.7!skip +molecule/default/roles/k8scopy/library/kubectl_file_compare.py compile-3.5!skip \ No newline at end of file diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 028d7e91..3ef6897e 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -235,3 +235,7 @@ plugins/modules/k8s_service.py metaclass-boilerplate!skip plugins/modules/k8s_service.py validate-modules:parameter-type-not-in-doc plugins/modules/k8s_service.py validate-modules:return-syntax-error tests/sanity/refresh_ignore_files shebang!skip +plugins/modules/k8s_cp.py compile-2.6!skip +plugins/modules/k8s_cp.py compile-2.7!skip +plugins/modules/k8s_cp.py import-2.6!skip +plugins/modules/k8s_cp.py import-2.7!skip \ No newline at end of file diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 8def4ec0..50579689 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -228,3 +228,10 @@ tests/unit/module_utils/test_discoverer.py future-import-boilerplate!skip tests/unit/module_utils/test_discoverer.py metaclass-boilerplate!skip molecule/default/roles/k8scopy/library/kubectl_file_compare.py shebang molecule/default/roles/k8scopy/library/k8s_create_file.py shebang +plugins/modules/k8s_cp.py compile-2.6!skip +plugins/modules/k8s_cp.py compile-2.7!skip +plugins/modules/k8s_cp.py import-2.6!skip +plugins/modules/k8s_cp.py import-2.7!skip +molecule/default/roles/k8scopy/library/kubectl_file_compare.py compile-2.6!skip +molecule/default/roles/k8scopy/library/kubectl_file_compare.py compile-2.7!skip +molecule/default/roles/k8scopy/library/kubectl_file_compare.py compile-3.5!skip \ No newline at end of file