Skip to content

Commit

Permalink
Excluded execution nodes from current logic. Next step to write a fun…
Browse files Browse the repository at this point in the history
…ction specifically for execution nodes.
  • Loading branch information
djyasin committed Jul 20, 2023
1 parent 1c69619 commit d5a0f27
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions awx/main/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def convert_cpu_str_to_decimal_cpu(cpu_str):
return max(0.1, round(cpu, 1))


def get_corrected_cpu(cpu_count): # formerlly get_cpu_capacity
def get_corrected_cpu(cpu_count, obj): # formerlly get_cpu_capacity
"""Some environments will do a correction to the reported CPU number
because the given OpenShift value is a lie
"""
Expand All @@ -760,11 +760,10 @@ def get_corrected_cpu(cpu_count): # formerlly get_cpu_capacity
settings_abscpu = getattr(settings, 'SYSTEM_TASK_ABS_CPU', None)
env_abscpu = os.getenv('SYSTEM_TASK_ABS_CPU', None)

if env_abscpu is not None:
if env_abscpu is not None and obj.node_type != 'execution':
return convert_cpu_str_to_decimal_cpu(env_abscpu)
elif settings_abscpu is not None:
return convert_cpu_str_to_decimal_cpu(settings_abscpu)

return cpu_count # no correction


Expand Down

0 comments on commit d5a0f27

Please sign in to comment.