mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-28 03:49:09 -07:00
Migrate basestring to a python3 compatible type (#17199)
This commit is contained in:
parent
a695e18615
commit
a22909c226
28 changed files with 137 additions and 101 deletions
|
@ -33,6 +33,7 @@ import shlex
|
|||
import itertools
|
||||
|
||||
from ansible.module_utils.basic import BOOLEANS_TRUE, BOOLEANS_FALSE
|
||||
from ansible.module_utils.six import string_types
|
||||
|
||||
DEFAULT_COMMENT_TOKENS = ['#', '!', '/*', '*/']
|
||||
|
||||
|
@ -197,7 +198,7 @@ class NetworkConfig(object):
|
|||
self.load(open(filename).read())
|
||||
|
||||
def get(self, path):
|
||||
if isinstance(path, basestring):
|
||||
if isinstance(path, string_types):
|
||||
path = [path]
|
||||
for item in self._config:
|
||||
if item.text == path[-1]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue