mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Fixing PY2 compile issues
This commit is contained in:
@@ -201,29 +201,27 @@ def test_completeness(collection_import, request, admin_user, job_template):
|
|||||||
longest_option_name = len(option)
|
longest_option_name = len(option)
|
||||||
|
|
||||||
# Print out some headers
|
# Print out some headers
|
||||||
print(
|
print("".join([
|
||||||
"End Point", " " * (longest_endpoint - len("End Point")),
|
"End Point", " " * (longest_endpoint - len("End Point")),
|
||||||
" | Module Name", " " * (longest_module_name - len("Module Name")),
|
" | Module Name", " " * (longest_module_name - len("Module Name")),
|
||||||
" | Option", " " * (longest_option_name - len("Option")),
|
" | Option", " " * (longest_option_name - len("Option")),
|
||||||
" | API | Module | State",
|
" | API | Module | State",
|
||||||
sep=""
|
]))
|
||||||
)
|
print("-|-".join([
|
||||||
print(
|
|
||||||
"-" * longest_endpoint,
|
"-" * longest_endpoint,
|
||||||
"-" * longest_module_name,
|
"-" * longest_module_name,
|
||||||
"-" * longest_option_name,
|
"-" * longest_option_name,
|
||||||
"---",
|
"---",
|
||||||
"------",
|
"------",
|
||||||
"---------------------------------------------",
|
"---------------------------------------------",
|
||||||
sep="-|-"
|
]))
|
||||||
)
|
|
||||||
|
|
||||||
# Print out all of our data
|
# Print out all of our data
|
||||||
for module in sorted(option_comparison):
|
for module in sorted(option_comparison):
|
||||||
module_data = option_comparison[module]
|
module_data = option_comparison[module]
|
||||||
all_param_names = list(set(module_data['api_options']) | set(module_data['module_options']))
|
all_param_names = list(set(module_data['api_options']) | set(module_data['module_options']))
|
||||||
for parameter in sorted(all_param_names):
|
for parameter in sorted(all_param_names):
|
||||||
print(
|
print("".join([
|
||||||
module_data['endpoint'], " " * (longest_endpoint - len(module_data['endpoint'])), " | ",
|
module_data['endpoint'], " " * (longest_endpoint - len(module_data['endpoint'])), " | ",
|
||||||
module_data['module_name'], " " * (longest_module_name - len(module_data['module_name'])), " | ",
|
module_data['module_name'], " " * (longest_module_name - len(module_data['module_name'])), " | ",
|
||||||
parameter, " " * (longest_option_name - len(parameter)), " | ",
|
parameter, " " * (longest_option_name - len(parameter)), " | ",
|
||||||
@@ -237,19 +235,17 @@ def test_completeness(collection_import, request, admin_user, job_template):
|
|||||||
'X' if (parameter in module_data['api_options']) else '',
|
'X' if (parameter in module_data['api_options']) else '',
|
||||||
'X' if (parameter in module_data['module_options']) else '',
|
'X' if (parameter in module_data['module_options']) else '',
|
||||||
),
|
),
|
||||||
sep=""
|
]))
|
||||||
)
|
|
||||||
# This handles cases were we got no params from the options page nor from the modules
|
# This handles cases were we got no params from the options page nor from the modules
|
||||||
if len(all_param_names) == 0:
|
if len(all_param_names) == 0:
|
||||||
print(
|
print("".join([
|
||||||
module_data['endpoint'], " " * (longest_endpoint - len(module_data['endpoint'])), " | ",
|
module_data['endpoint'], " " * (longest_endpoint - len(module_data['endpoint'])), " | ",
|
||||||
module_data['module_name'], " " * (longest_module_name - len(module_data['module_name'])), " | ",
|
module_data['module_name'], " " * (longest_module_name - len(module_data['module_name'])), " | ",
|
||||||
"N/A", " " * (longest_option_name - len("N/A")), " | ",
|
"N/A", " " * (longest_option_name - len("N/A")), " | ",
|
||||||
' ', " | ",
|
' ', " | ",
|
||||||
' ', " | ",
|
' ', " | ",
|
||||||
determine_state(module, module_data['endpoint'], module_data['module_name'], 'N/A', '', ''),
|
determine_state(module, module_data['endpoint'], module_data['module_name'], 'N/A', '', ''),
|
||||||
sep=""
|
]))
|
||||||
)
|
|
||||||
|
|
||||||
if return_value != 0:
|
if return_value != 0:
|
||||||
raise Exception("One or more failures caused issues")
|
raise Exception("One or more failures caused issues")
|
||||||
|
|||||||
Reference in New Issue
Block a user