mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Code smell test for iteritems and itervalues (#19292)
* Code smell test for iteritems and itervalues * Change the keydict object in authorized_keys so it doesn't throw a false postive keydict is a bad data structure anyway. We don't use the iteritems and itervalues methods so just disable them so that the code-smell tests do not trigger on it. * Change release templates so they work with py3
This commit is contained in:
parent
f550b4541f
commit
0b440a9289
4 changed files with 48 additions and 6 deletions
|
@ -233,16 +233,16 @@ class keydict(dict):
|
|||
yield key, self[key][indexes[key]]
|
||||
|
||||
def iteritems(self):
|
||||
return self._item_generator()
|
||||
raise NotImplementedError("Do not use this as it's not available on py3")
|
||||
|
||||
def items(self):
|
||||
return list(self.iteritems())
|
||||
return list(self._item_generator())
|
||||
|
||||
def itervalues(self):
|
||||
return (item[1] for item in self.iteritems())
|
||||
raise NotImplementedError("Do not use this as it's not available on py3")
|
||||
|
||||
def values(self):
|
||||
return list(self.itervalues())
|
||||
return [item[1] for item in self.items()]
|
||||
|
||||
|
||||
def keyfile(module, user, write=False, path=None, manage_dir=True):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue