Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Commit

Permalink
Parse format (xml or text) when editing config (#6)
Browse files Browse the repository at this point in the history
NikosGkotsis authored and vkosuri committed Nov 22, 2016
1 parent 5391339 commit 6227b17
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/NcclientLibrary/NcclientKeywords.py
Original file line number Diff line number Diff line change
@@ -183,7 +183,7 @@ def get_config(self, alias, source, filter_type='subtree',
raise str(e)

def edit_config(self, alias, target, config, default_operation=None,
test_option=None, error_option=None):
test_option=None, error_option=None, format='xml'):
"""
Loads all or part of the specified config to the target
configuration datastore.
@@ -203,6 +203,8 @@ def edit_config(self, alias, target, config, default_operation=None,
``error_option`` if specified must be one of
{ ?stop-on-error?, ?continue-on-error?, ?rollback-on-error? }
``format`` if specified must be one of { ?xml?, ?text?}
The ?rollback-on-error? error_option depends on the :rollback-on-error
adaptability.
@@ -213,8 +215,9 @@ def edit_config(self, alias, target, config, default_operation=None,
logger.info("target: %s, config: %s, default_operation: %s \
test_option: %s, error_option: %s"
% (target, config, default_operation, test_option, error_option))
session.edit_config(target, config, default_operation,
test_option, error_option)
session.edit_config(config, format, target, default_operation,
test_option, error_option)

except NcclientException as e:
logger.error(str(e))
raise str(e)

0 comments on commit 6227b17

Please sign in to comment.