Skip to content

Commit

Permalink
pylint: Fix use-dict-literal
Browse files Browse the repository at this point in the history
Pylint 2.10 introduced new checker use-dict-literal:
> Added use-dict-literal: Emitted when dict() is called with no
  arguments instead of using {}

https://pylint.pycqa.org/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-10-0
pylint-dev/pylint#4365

Fixes: freeipa#244
Signed-off-by: Stanislav Levin <slev@altlinux.org>
  • Loading branch information
stanislavlevin committed Feb 15, 2022
1 parent 666d654 commit 77330e8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ipahealthcheck/core/plugin.py
Expand Up @@ -41,7 +41,7 @@ class some_plugin(...):
def __init__(self):
self.plugins = []
self.framework = None
self.config = dict()
self.config = {}
self.options = None

def initialize(self, framework, config, options=None):
Expand Down
6 changes: 3 additions & 3 deletions src/ipahealthcheck/ipa/idns.py
Expand Up @@ -60,9 +60,9 @@ def check(self):
base_records = system_records.get_base_records()

# collect the list of expected values
txt_rec = dict()
srv_rec = dict()
uri_rec = dict()
txt_rec = {}
srv_rec = {}
uri_rec = {}
a_rec = list()
aaaa_rec = list()

Expand Down
2 changes: 1 addition & 1 deletion src/ipahealthcheck/ipa/trust.py
Expand Up @@ -48,7 +48,7 @@ def get_trust_domains():
for cn in trust.get('cn'):
trustdomains = api.Command.trustdomain_find(cn, raw=True)
for trustdomain in trustdomains['result']:
domain = dict()
domain = {}
domain['domain'] = trustdomain.get('cn')[0]
domain['domainsid'] = trustdomain.get(
'ipanttrusteddomainsid')[0]
Expand Down
2 changes: 1 addition & 1 deletion tests/util.py
Expand Up @@ -88,7 +88,7 @@ def __init__(self, attr_name=None, name=None, component_services=None):
pass

def status(self, api_instance, server=None, attrs_list=("*",)):
return [dict()]
return [{}]


class ADtrustBasedRole(ServiceBasedRole):
Expand Down

0 comments on commit 77330e8

Please sign in to comment.