Skip to content

Commit dad9496

Browse files
authored
Merge pull request #461 from renan-lopes-rodrigues/master
Changed factory to add config header on xml deploy
2 parents b5a2d9d + 929639b commit dad9496

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

networkapi/plugins/Netconf/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,16 @@ def exec_command(self, command, success_regex='', invalid_regex=None, error_rege
190190
self.__try_lock() # Do nothing, will be executed by the locked method of ncclient
191191
# Here we make a request to a microservice that runs in docker with python 3
192192

193+
ultimate_template = '<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">{}</config>'.format(command)
194+
193195
response = requests.post(
194196
url="http://localhost:5000/deploy",
195197
headers={"Content-type": "application/json"},
196198
data=json.dumps({
197199
"address": self.equipment_access.fqdn,
198200
"username": self.equipment_access.user,
199201
"password": self.equipment_access.password,
200-
"configuration": command
202+
"configuration": ultimate_template
201203
})
202204
)
203205

0 commit comments

Comments
 (0)