<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Python runtime Error while implementing netdevops-demo (NSO and Ansible) in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186099#M5845</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I am trying to implement NSO and Ansible netdevops-demo located at (&lt;A href="https://github.com/NSO-developer/netdevops-demo" target="_blank" rel="noopener"&gt;https://github.com/NSO-developer/netdevops-demo&lt;/A&gt;),While running python, I am getting error is shown below , I am also attaching the python code which is used to generate Ansible configuration in this demo. if anyone has known to solve these errors please reply , the operation system I am using is ubuntu 16.04 LTS.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error while running code on python2 ..........&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;user@eve-ng:~/ncs-run/netdevops-demo$ python generate_ansible.py&lt;BR /&gt;Syncing Configuration from Devices&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "generate_ansible.py", line 57, in &amp;lt;module&amp;gt;&lt;BR /&gt;main()&lt;BR /&gt;File "generate_ansible.py", line 27, in main&lt;BR /&gt;nso.sync_from()&lt;BR /&gt;File "/home/user/ncs-run/netdevops-demo/helpers/nso.py", line 69, in sync_from&lt;BR /&gt;resp = self.post(url)&lt;BR /&gt;File "/home/user/ncs-run/netdevops-demo/helpers/nso.py", line 62, in post&lt;BR /&gt;response.raise_for_status()&lt;BR /&gt;File "/home/user/.local/lib/python2.7/site-packages/requests/models.py", line 935, in raise_for_status&lt;BR /&gt;raise HTTPError(http_error_msg, response=self)&lt;BR /&gt;requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:8080/api/config/devices/_operations/sync-from&lt;BR /&gt;&lt;A href="mailto:user@eve-ng:~/ncs-run/netdevops-demo$" target="_blank" rel="noopener"&gt;user@eve-ng:~/ncs-run/netdevops-demo$ &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error while running code on&amp;nbsp; python3 .............&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;user@eve-ng:~/ncs-run/netdevops-demo$ python3 generate_ansible.py&lt;BR /&gt;/usr/local/lib/python3.5/dist-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release of cryptography. Please upgrade your Python.&lt;BR /&gt;from cryptography import x509&lt;BR /&gt;Syncing Configuration from Devices&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "generate_ansible.py", line 57, in &amp;lt;module&amp;gt;&lt;BR /&gt;main()&lt;BR /&gt;File "generate_ansible.py", line 27, in main&lt;BR /&gt;nso.sync_from()&lt;BR /&gt;File "/home/user/ncs-run/netdevops-demo/helpers/nso.py", line 69, in sync_from&lt;BR /&gt;resp = self.post(url)&lt;BR /&gt;File "/home/user/ncs-run/netdevops-demo/helpers/nso.py", line 62, in post&lt;BR /&gt;response.raise_for_status()&lt;BR /&gt;File "/usr/local/lib/python3.5/dist-packages/requests/models.py", line 935, in raise_for_status&lt;BR /&gt;raise HTTPError(http_error_msg, response=self)&lt;BR /&gt;requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:8080/api/config/devices/_operations/sync-from&lt;BR /&gt;&lt;A href="mailto:user@eve-ng:~/ncs-run/netdevops-demo$" target="_blank" rel="noopener"&gt;user@eve-ng:~/ncs-run/netdevops-demo$ &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Nov 2020 20:16:36 GMT</pubDate>
    <dc:creator>ZAhmad04890</dc:creator>
    <dc:date>2020-11-19T20:16:36Z</dc:date>
    <item>
      <title>Python runtime Error while implementing netdevops-demo (NSO and Ansible)</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186099#M5845</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I am trying to implement NSO and Ansible netdevops-demo located at (&lt;A href="https://github.com/NSO-developer/netdevops-demo" target="_blank" rel="noopener"&gt;https://github.com/NSO-developer/netdevops-demo&lt;/A&gt;),While running python, I am getting error is shown below , I am also attaching the python code which is used to generate Ansible configuration in this demo. if anyone has known to solve these errors please reply , the operation system I am using is ubuntu 16.04 LTS.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error while running code on python2 ..........&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;user@eve-ng:~/ncs-run/netdevops-demo$ python generate_ansible.py&lt;BR /&gt;Syncing Configuration from Devices&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "generate_ansible.py", line 57, in &amp;lt;module&amp;gt;&lt;BR /&gt;main()&lt;BR /&gt;File "generate_ansible.py", line 27, in main&lt;BR /&gt;nso.sync_from()&lt;BR /&gt;File "/home/user/ncs-run/netdevops-demo/helpers/nso.py", line 69, in sync_from&lt;BR /&gt;resp = self.post(url)&lt;BR /&gt;File "/home/user/ncs-run/netdevops-demo/helpers/nso.py", line 62, in post&lt;BR /&gt;response.raise_for_status()&lt;BR /&gt;File "/home/user/.local/lib/python2.7/site-packages/requests/models.py", line 935, in raise_for_status&lt;BR /&gt;raise HTTPError(http_error_msg, response=self)&lt;BR /&gt;requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:8080/api/config/devices/_operations/sync-from&lt;BR /&gt;&lt;A href="mailto:user@eve-ng:~/ncs-run/netdevops-demo$" target="_blank" rel="noopener"&gt;user@eve-ng:~/ncs-run/netdevops-demo$ &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error while running code on&amp;nbsp; python3 .............&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;user@eve-ng:~/ncs-run/netdevops-demo$ python3 generate_ansible.py&lt;BR /&gt;/usr/local/lib/python3.5/dist-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release of cryptography. Please upgrade your Python.&lt;BR /&gt;from cryptography import x509&lt;BR /&gt;Syncing Configuration from Devices&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "generate_ansible.py", line 57, in &amp;lt;module&amp;gt;&lt;BR /&gt;main()&lt;BR /&gt;File "generate_ansible.py", line 27, in main&lt;BR /&gt;nso.sync_from()&lt;BR /&gt;File "/home/user/ncs-run/netdevops-demo/helpers/nso.py", line 69, in sync_from&lt;BR /&gt;resp = self.post(url)&lt;BR /&gt;File "/home/user/ncs-run/netdevops-demo/helpers/nso.py", line 62, in post&lt;BR /&gt;response.raise_for_status()&lt;BR /&gt;File "/usr/local/lib/python3.5/dist-packages/requests/models.py", line 935, in raise_for_status&lt;BR /&gt;raise HTTPError(http_error_msg, response=self)&lt;BR /&gt;requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:8080/api/config/devices/_operations/sync-from&lt;BR /&gt;&lt;A href="mailto:user@eve-ng:~/ncs-run/netdevops-demo$" target="_blank" rel="noopener"&gt;user@eve-ng:~/ncs-run/netdevops-demo$ &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 20:16:36 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186099#M5845</guid>
      <dc:creator>ZAhmad04890</dc:creator>
      <dc:date>2020-11-19T20:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Python runtime Error while implementing netdevops-demo (NSO and Ansible)</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186350#M5849</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the repository you are referring to has last been updated 2 years ago.&lt;/P&gt;
&lt;P&gt;The URL that is causing you trouble is using the REST API which has been deprecated in favor of the RESTCONF API starting NSO 5.3 - what NSO version are you using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This URL:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;http://localhost:8080/api/config/devices/_operations/sync-from&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;should be replaced with:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;http://localhost:8080/restconf/data/tailf-ncs:devices/sync-from&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have a couple of other occurrences of the legacy REST API in this file that would need to be replaced as well:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/NSO-developer/netdevops-demo/blob/master/helpers/nso.py#L68" target="_blank"&gt;https://github.com/NSO-developer/netdevops-demo/blob/master/helpers/nso.py&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 08:54:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186350#M5849</guid>
      <dc:creator>gmuloche</dc:creator>
      <dc:date>2020-11-20T08:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python runtime Error while implementing netdevops-demo (NSO and Ansible)</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186437#M5850</link>
      <description>&lt;P&gt;Hi and Thanks for your reply , I am using NSO 5.3 . only NSO 5.3 is available on developer.cisco.com for free download , If NSO 5.2 was available, I would have just installed it.&lt;/P&gt;&lt;P&gt;I have tried to search for NSO 5.2 , but wasnt able to find any where free to download, and I do not have&amp;nbsp; a cisco account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding&amp;nbsp; the new NSO 5.3 RESTCONF API : does its communication with net-sim&amp;nbsp; device depend on the selection from one of the following four options , or it it in dependent of these four options , as shown below? outputs from NSO are shown as reference.Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1)netconf&lt;/P&gt;&lt;P&gt;2)generic&lt;/P&gt;&lt;P&gt;3)snmp&lt;/P&gt;&lt;P&gt;4)cli&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;admin@ncs(config-device-router0)# address 127.0.0.1 port 10022 device-type ?&lt;BR /&gt;Possible completions:&lt;BR /&gt;cli Use CLI to communicate with the device&lt;BR /&gt;generic Use a generic NED to talk to the device&lt;BR /&gt;netconf&lt;BR /&gt;snmp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;user@eve-ng:~/nso-instance/netdevops-demo$ ncs-netsim list&lt;BR /&gt;ncs-netsim list for /home/user/nso-instance/netdevops-demo/netsim&lt;/P&gt;&lt;P&gt;name=router0 netconf=12022 snmp=11022 ipc=5010 cli=10022 dir=/home/user/nso-instance/netdevops-demo/netsim/router/router0&lt;BR /&gt;name=router1 netconf=12023 snmp=11023 ipc=5011 cli=10023 dir=/home/user/nso-instance/netdevops-demo/netsim/router/router1&lt;BR /&gt;name=router2 netconf=12024 snmp=11024 ipc=5012 cli=10024 dir=/home/user/nso-instance/netdevops-demo/netsim/router/router2&lt;BR /&gt;user@eve-ng:~/nso-instance/netdevops-demo$&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 12:27:47 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186437#M5850</guid>
      <dc:creator>ZAhmad04890</dc:creator>
      <dc:date>2020-11-20T12:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Python runtime Error while implementing netdevops-demo (NSO and Ansible)</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186606#M5854</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the communication in REST is between the script being run and the NSO instance not between NSO and the Netsim devices.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have made the required modifications in this fork of the repo:&amp;nbsp;&lt;A href="https://github.com/gmuloc/netdevops-demo/tree/restconf" target="_blank"&gt;https://github.com/gmuloc/netdevops-demo/tree/restconf&lt;/A&gt;&amp;nbsp;that should allow you to run the demo with NSO 5.3. Note that it is using python 3. You can give it a go and let me know here if this works for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 18:20:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186606#M5854</guid>
      <dc:creator>gmuloche</dc:creator>
      <dc:date>2020-11-20T18:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Python runtime Error while implementing netdevops-demo (NSO and Ansible)</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186821#M5855</link>
      <description>&lt;P&gt;Hi , Thanks and the code works now !!! ,&lt;/P&gt;&lt;P&gt;as a side note on ubutnu 18.04 while working in&amp;nbsp; python3 virtual environment, its still giving depreciation warning for ansible, which I am not sure why?. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(venv3) ahmad@ahmad:~/ncs-run/netdevops-demo-restconf$ ansible-playbook -i inventory.yaml site.yaml&lt;/P&gt;&lt;P&gt;PLAY [Check Synchronization of Devices] ****************************************&lt;/P&gt;&lt;P&gt;TASK [check-sync] **************************************************************&lt;BR /&gt;changed: [localhost]&lt;/P&gt;&lt;P&gt;PLAY [Verify device configuration] *********************************************&lt;/P&gt;&lt;P&gt;TASK [Device configuration] ****************************************************&lt;BR /&gt;[DEPRECATION WARNING]: Distribution Ubuntu 18.04 on host router1 should use&lt;BR /&gt;/usr/bin/python3, but is using /usr/bin/python for backward compatibility with&lt;BR /&gt;prior Ansible releases. A future Ansible release will default to using the&lt;BR /&gt;discovered platform python for this host. See &lt;A href="https://docs.ansible.com/ansible/" target="_blank"&gt;https://docs.ansible.com/ansible/&lt;/A&gt;&lt;BR /&gt;2.10/reference_appendices/interpreter_discovery.html for more information. This&lt;BR /&gt;feature will be removed in version 2.12. Deprecation warnings can be disabled&lt;BR /&gt;by setting deprecation_warnings=False in ansible.cfg.&lt;BR /&gt;ok: [router1]&lt;BR /&gt;[DEPRECATION WARNING]: Distribution Ubuntu 18.04 on host router2 should use&lt;BR /&gt;/usr/bin/python3, but is using /usr/bin/python for backward compatibility with&lt;BR /&gt;prior Ansible releases. A future Ansible release will default to using the&lt;BR /&gt;discovered platform python for this host. See &lt;A href="https://docs.ansible.com/ansible/" target="_blank"&gt;https://docs.ansible.com/ansible/&lt;/A&gt;&lt;BR /&gt;2.10/reference_appendices/interpreter_discovery.html for more information. This&lt;BR /&gt;feature will be removed in version 2.12. Deprecation warnings can be disabled&lt;BR /&gt;by setting deprecation_warnings=False in ansible.cfg.&lt;BR /&gt;ok: [router2]&lt;BR /&gt;[DEPRECATION WARNING]: Distribution Ubuntu 18.04 on host router0 should use&lt;BR /&gt;/usr/bin/python3, but is using /usr/bin/python for backward compatibility with&lt;BR /&gt;prior Ansible releases. A future Ansible release will default to using the&lt;BR /&gt;discovered platform python for this host. See &lt;A href="https://docs.ansible.com/ansible/" target="_blank"&gt;https://docs.ansible.com/ansible/&lt;/A&gt;&lt;BR /&gt;2.10/reference_appendices/interpreter_discovery.html for more information. This&lt;BR /&gt;feature will be removed in version 2.12. Deprecation warnings can be disabled&lt;BR /&gt;by setting deprecation_warnings=False in ansible.cfg.&lt;BR /&gt;ok: [router0]&lt;/P&gt;&lt;P&gt;PLAY [Push Desired Configuration to Devices] ***********************************&lt;/P&gt;&lt;P&gt;TASK [NSO sync-to action] ******************************************************&lt;BR /&gt;changed: [localhost]&lt;/P&gt;&lt;P&gt;PLAY RECAP *********************************************************************&lt;BR /&gt;localhost : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0&lt;BR /&gt;router0 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0&lt;BR /&gt;router1 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0&lt;BR /&gt;router2 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0&lt;/P&gt;&lt;P&gt;(venv3) ahmad@ahmad:~/ncs-run/netdevops-demo-restconf$&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 08:16:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/python-runtime-error-while-implementing-netdevops-demo-nso-and/m-p/4186821#M5855</guid>
      <dc:creator>ZAhmad04890</dc:creator>
      <dc:date>2020-11-21T08:16:07Z</dc:date>
    </item>
  </channel>
</rss>

