ktbyers / pynet

Python for Network Engineers
Apache License 2.0
582 stars 515 forks source link

Nornir support on windows 10? #14

Closed chiragvyas50 closed 4 years ago

chiragvyas50 commented 6 years ago

Hi Kirk,

I read your article "Using Nornir for OS Upgrades (Part 1)" and it is really nice article. During the reading, i have couple of question. I would appreciate if you can help me with these queries I am using Windows 10 machine.

1) Where should i keep hosts.yaml and groups.yaml on windows path? 2) Nornir is supported fully on windows?

chiragvyas50 commented 6 years ago

No Worries Kirk!

I found it, i got little bit confused. Good for now.

ktbyers commented 6 years ago

@chiragvyas50 Let me know if Nornir works on Windows (or not). I don't know if it has been tested or not.

chiragvyas50 commented 6 years ago

Yes Kirk, I tested it and it is working fine on Windows! I have my Python setup on Windows machine, Let me know whenever you want to do any testing on Windows side!

ktbyers commented 6 years ago

Yes, it would be interesting to know if Nornir 2.0 works on Windows or not. I have some details here on how to install Nornir 2.0.

https://pynet.twb-tech.com/blog/nornir/os-upgrade-p1.html

chiragvyas50 commented 6 years ago

Hi Kirk,

Sorry for late replay, i got stuck with some other stuff so coudn't reply this thread. Anyways, i did testing on my windows 10 machine for Nornir 2.0 and it is working perfectly fine.

Conclusion Nornir 2.0 & 1.1 works on Windows 10! I have installed git on my laptop before installing Nornir 2.0(Obviously i would need git on laptop...lol !!)

Here are the steps that i followed on Windows Machine

Below are the traces if someone need detail

Uninstall Norni 1.0 C:\Python37\Lib\site-packages>pip uninstall nornir Uninstalling nornir-1.1.0: Would remove: c:\python37\lib\site-packages\nornir-1.1.0.dist-info* c:\python37\lib\site-packages\nornir* Would not remove (might be manually added): c:\python37\lib\site-packages\nornir\core\hosts.yaml c:\python37\lib\site-packages\nornir\core\new text document.txt c:\python37\lib\site-packages\nornir\plugins\inventory\hosts.yaml Proceed (y/n)? y Successfully uninstalled nornir-1.1.0

Install Norni 2.0 C:\Python37\Lib\site-packages>git clone https://github.com/nornir-automation/nornir Cloning into 'nornir'... remote: Counting objects: 4333, done. remote: Compressing objects: 100% (162/162), done. remote: Total 4333 (delta 130), reused 196 (delta 99), pack-reused 4066R Receiving objects: 100% (4333/4333), 2.11 MiB | 5.81 MiB/s, done. Resolving deltas: 100% (2590/2590), done.

C:\Python37\Lib\site-packages>cd nornir

C:\Python37\Lib\site-packages\nornir>git branch

C:\Python37\Lib\site-packages\nornir>git fetch origin

C:\Python37\Lib\site-packages\nornir>git checkout -b 2.0 origin/2.0 Switched to a new branch '2.0' Branch '2.0' set up to track remote branch '2.0' from 'origin'.

C:\Python37\Lib\site-packages\nornir>git branch

C:\Python37\Lib\site-packages\nornir>pip install -r ./requirements-dev.txt

C:\Python37\Lib\site-packages\nornir>pip install -e .

Verify Version of the nornir C:\Python37\Lib\site-packages\nornir>pip list

Package Version Location
nornir 2.0.0 c:\python37\lib\site-packages\nornir

C:\Python37\Lib\site-packages\nornir>pip show nornir Name: nornir Version: 2.0.0 Summary: Fighting fire with fire Home-page: https://github.com/nornir-automation/nornir Author: dbarrosop@dravetech.com Author-email: None License: Apache License, version 2 Location: c:\python37\lib\site-packages\nornir Requires: colorama, jinja2, napalm, netmiko, paramiko, future, requests, ruamel.yaml, mypy-extensions Required-by:

medskept commented 6 years ago

Thank you 👍 , very usefull.

mccloudiii commented 4 years ago

Hi

Hi Kirk,

Sorry for late replay, i got stuck with some other stuff so coudn't reply this thread. Anyways, i did testing on my windows 10 machine for Nornir 2.0 and it is working perfectly fine.

Conclusion Nornir 2.0 & 1.1 works on Windows 10! I have installed git on my laptop before installing Nornir 2.0(Obviously i would need git on laptop...lol !!)

Here are the steps that i followed on Windows Machine

* Uninstall Norni 1.0 (It is not necessary though, i just uninstalled because i wanted to see the fresh Nornir 2.0 copy)

* Install Git for Windows

* Followed your instruction about installing Nornir 2.0

* i used "C:\Python37\Lib\site-packages" as home directory for Nornir 2.0 because all other libraries are installed at this location on my computer

* Tested using Small Python Script to fetch "Show ip int brief" output on 3 devices

* It is Working!!!

Below are the traces if someone need detail

Uninstall Norni 1.0 C:\Python37\Lib\site-packages>pip uninstall nornir Uninstalling nornir-1.1.0: Would remove: c:\python37\lib\site-packages\nornir-1.1.0.dist-info c:\python37\lib\site-packages\nornir Would not remove (might be manually added): c:\python37\lib\site-packages\nornir\core\hosts.yaml c:\python37\lib\site-packages\nornir\core\new text document.txt c:\python37\lib\site-packages\nornir\plugins\inventory\hosts.yaml Proceed (y/n)? y Successfully uninstalled nornir-1.1.0

Install Norni 2.0 C:\Python37\Lib\site-packages>git clone https://github.com/nornir-automation/nornir Cloning into 'nornir'... remote: Counting objects: 4333, done. remote: Compressing objects: 100% (162/162), done. remote: Total 4333 (delta 130), reused 196 (delta 99), pack-reused 4066R Receiving objects: 100% (4333/4333), 2.11 MiB | 5.81 MiB/s, done. Resolving deltas: 100% (2590/2590), done.

C:\Python37\Lib\site-packages>cd nornir

C:\Python37\Lib\site-packages\nornir>git branch

* develop

C:\Python37\Lib\site-packages\nornir>git fetch origin

C:\Python37\Lib\site-packages\nornir>git checkout -b 2.0 origin/2.0 Switched to a new branch '2.0' Branch '2.0' set up to track remote branch '2.0' from 'origin'.

C:\Python37\Lib\site-packages\nornir>git branch

* 2.0
  develop

C:\Python37\Lib\site-packages\nornir>pip install -r ./requirements-dev.txt

C:\Python37\Lib\site-packages\nornir>pip install -e .

Verify Version of the nornir C:\Python37\Lib\site-packages\nornir>pip list Package Version Location nornir 2.0.0 c:\python37\lib\site-packages\nornir

C:\Python37\Lib\site-packages\nornir>pip show nornir Name: nornir Version: 2.0.0 Summary: Fighting fire with fire Home-page: https://github.com/nornir-automation/nornir Author: dbarrosop@dravetech.com Author-email: None License: Apache License, version 2 Location: c:\python37\lib\site-packages\nornir Requires: colorama, jinja2, napalm, netmiko, paramiko, future, requests, ruamel.yaml, mypy-extensions Required-by:

Could you please give details on this? Followed your instruction about installing Nornir 2.0

Thanks BR! HA