File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
module_utils/network/netconf Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -132,3 +132,12 @@ def sanitize_xml(data):
132132 if key not in IGNORE_XML_ATTRIBUTE :
133133 attribute .pop (key )
134134 return to_text (tostring (tree ), errors = "surrogate_then_replace" ).strip ()
135+
136+ def copy_config (module , source , target ):
137+ conn = get_connection (module )
138+ try :
139+ response = conn .copy_config (source = source , target = target )
140+ except ConnectionError as e :
141+ module .fail_json (msg = to_text (e , errors = "surrogate_then_replace" ).strip ())
142+ return response
143+
Original file line number Diff line number Diff line change @@ -598,7 +598,7 @@ def main():
598598 conn .validate (target )
599599 if source :
600600 if not module .check_mode :
601- conn .copy (source , target )
601+ conn .copy_config (source , target )
602602 result ["changed" ] = True
603603 elif delete :
604604 if not module .check_mode :
You can’t perform that action at this time.
0 commit comments