diff --git a/cookbooks/aws-parallelcluster-computefleet/files/clusterstatusmgtd/clusterstatusmgtd.py b/cookbooks/aws-parallelcluster-computefleet/files/clusterstatusmgtd/clusterstatusmgtd.py index 8067f1fc8..278883e19 100644 --- a/cookbooks/aws-parallelcluster-computefleet/files/clusterstatusmgtd/clusterstatusmgtd.py +++ b/cookbooks/aws-parallelcluster-computefleet/files/clusterstatusmgtd/clusterstatusmgtd.py @@ -68,7 +68,7 @@ def log_exception( ): def decorator_log_exception(function): @functools.wraps(function) - def wrapper_log_expection(*args, **kwargs): # pylint: disable=R1710 + def wrapper_log_exception(*args, **kwargs): # pylint: disable=R1710 try: return function(*args, **kwargs) except catch_exception as e: @@ -77,8 +77,9 @@ def wrapper_log_expection(*args, **kwargs): # pylint: disable=R1710 if exception_to_raise: raise exception_to_raise raise + return None - return wrapper_log_expection + return wrapper_log_exception return decorator_log_exception diff --git a/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config_util.py b/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config_util.py index bc0fcb3bd..c51093a53 100644 --- a/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config_util.py +++ b/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config_util.py @@ -158,6 +158,7 @@ def remove_backup(): try: os.remove(LOG_CONFIGS_BAK_PATH) except FileNotFoundError: + # No need to remove the file, as the file isn't found anyway pass diff --git a/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb b/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb index fbc798081..c825b672f 100644 --- a/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb +++ b/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb @@ -64,7 +64,7 @@ describe file('/usr/local/bin/cloudwatch_agent_config_util.py') do it { should exist } - its('sha256sum') { should eq '980b0ba6e5922fe2983d3e866ac970622f59a26a4829b8262466739582176525' } + its('sha256sum') { should eq 'b816b4891a5e8f1e7ac94616db7927f7955ba72a8f53ec1b320402a2ac9c9b7f' } its('owner') { should eq 'root' } its('group') { should eq 'root' } its('mode') { should cmp '0644' }