mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
adds get_block_config() method to NetworkConfig
new method that will return the config block string for the specified config path
This commit is contained in:
@@ -224,6 +224,10 @@ class NetworkConfig(object):
|
|||||||
raise ValueError('path does not exist in config')
|
raise ValueError('path does not exist in config')
|
||||||
return self._expand_block(obj)
|
return self._expand_block(obj)
|
||||||
|
|
||||||
|
def get_block_config(self, path):
|
||||||
|
block = self.get_block(path)
|
||||||
|
return dumps(block, 'config')
|
||||||
|
|
||||||
def _expand_block(self, configobj, S=None):
|
def _expand_block(self, configobj, S=None):
|
||||||
if S is None:
|
if S is None:
|
||||||
S = list()
|
S = list()
|
||||||
|
|||||||
Reference in New Issue
Block a user