Skip to content
/ hotsos Public
forked from canonical/hotsos

Commit

Permalink
fix ci breakage after canonical@dd51c3f (canonical#959)
Browse files Browse the repository at this point in the history
the ci is failing due to pylint too-many-arguments and duplicate-code warnings.

it's an example for the issue described here: canonical#957

fixed the following:

too-many-arguments: removed svc parameter from the _check_item_settings
as it's already included in the service object.

duplicate-code: suppressed the warning.

Signed-off-by: Mustafa Kemal Gilor <[email protected]>
  • Loading branch information
xmkg authored Jul 30, 2024
1 parent dd51c3f commit 5782eb7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions hotsos/core/ycheck/engine/properties/requires/types/pebble.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class YRequirementTypePebble(service_manager_common.ServiceManagerTypeBase):
override_autoregister = True
default_op = 'eq'

def _check_item_settings(self, svc, svc_obj, settings, cache_info,
def _check_item_settings(self, svc_obj, settings, cache_info,
all_items):
processes = None
if isinstance(settings, str):
Expand All @@ -46,8 +46,8 @@ def _check_item_settings(self, svc, svc_obj, settings, cache_info,
"- %s", ', '.join(processes))
return False

cache_info[svc]['ops'] = self.ops_to_str(ops)
return self.self.apply_ops(ops, input=svc_obj.state)
cache_info[svc_obj.name]['ops'] = self.ops_to_str(ops)
return self.apply_ops(ops, opinput=svc_obj.state)

@property
def items_to_check(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _result(self):
if settings is None:
continue

_result = self._check_item_settings(svc, svc_obj, settings,
_result = self._check_item_settings(svc_obj, settings,
cache_info, items)
if not _result:
# bail on first fail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _check_service(self, svc, ops, started_after=None):

return self.apply_ops(ops, opinput=svc.state)

def _check_item_settings(self, svc, svc_obj, settings, cache_info,
def _check_item_settings(self, svc_obj, settings, cache_info,
all_items):
# pylint: disable=duplicate-code
processes = None
Expand All @@ -100,7 +100,7 @@ def _check_item_settings(self, svc, svc_obj, settings, cache_info,
"- %s", ', '.join(processes))
return False

cache_info[svc]['ops'] = self.ops_to_str(ops)
cache_info[svc_obj.name]['ops'] = self.ops_to_str(ops)
return self._check_service(svc_obj, ops,
started_after=started_after_obj)

Expand Down
1 change: 1 addition & 0 deletions hotsos/plugin_extensions/openstack/agent/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ class ApparmorCallback(OpenstackEventCallbackBase):
event_names = ['nova', 'neutron']

def __call__(self, event):
# pylint: disable=duplicate-code
results = [{'date': f"{r.get(1)} {r.get(2)}",
'time': r.get(3),
'key': r.get(4)} for r in event.results]
Expand Down
1 change: 1 addition & 0 deletions hotsos/plugin_extensions/openvswitch/event_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class OVSEventCallbackDALR(OpenvSwitchEventCallbackBase):
event_names = ['deferred-action-limit-reached']

def __call__(self, event):
# pylint: disable=duplicate-code
results = [{'date': f"{r.get(1)} {r.get(2)}",
'time': r.get(3),
'key': r.get(4)} for r in event.results]
Expand Down

0 comments on commit 5782eb7

Please sign in to comment.