Skip to content

Commit 84da5db

Browse files
authored
Merge pull request #462 from globocom/develop
Develop
2 parents d239b5c + dad9496 commit 84da5db

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)