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

Parse format (xml or text) when editing config #6

Merged
merged 1 commit into from
Nov 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/NcclientLibrary/NcclientKeywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.

Expand All @@ -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)
Expand Down