mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
minor update to the default comment tokens in netcfg
* adds checkout /* and */ as comment delimiters * now raises exception if invalid output keyword value is used
This commit is contained in:
parent
e560bfeaca
commit
ab3c5a0a17
1 changed files with 3 additions and 1 deletions
|
@ -26,7 +26,7 @@ import itertools
|
||||||
from ansible.module_utils.basic import BOOLEANS_TRUE, BOOLEANS_FALSE
|
from ansible.module_utils.basic import BOOLEANS_TRUE, BOOLEANS_FALSE
|
||||||
from ansible.module_utils.network import to_list
|
from ansible.module_utils.network import to_list
|
||||||
|
|
||||||
DEFAULT_COMMENT_TOKENS = ['#', '!']
|
DEFAULT_COMMENT_TOKENS = ['#', '!', '/*', '*/']
|
||||||
|
|
||||||
|
|
||||||
class ConfigLine(object):
|
class ConfigLine(object):
|
||||||
|
@ -119,6 +119,8 @@ def dumps(objects, output='block'):
|
||||||
line.extend([p.text for p in obj.parents])
|
line.extend([p.text for p in obj.parents])
|
||||||
line.append(obj.text)
|
line.append(obj.text)
|
||||||
items.append(' '.join(line))
|
items.append(' '.join(line))
|
||||||
|
else:
|
||||||
|
raise TypeError('unknown value supplied for keyword output')
|
||||||
return '\n'.join(items)
|
return '\n'.join(items)
|
||||||
|
|
||||||
class NetworkConfig(object):
|
class NetworkConfig(object):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue