Replies: 1 comment 6 replies
-
You can just reference variables when calling import sys
site_name = sys.argv[1]
model_name = sys.argv[2]
nornir_object.filter(F(site=site_name) & F(model__contains=model_name)) |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say I have a script which sends commands to devices.
today I need to filter inventory like:
nornir_object.filter(F(site='site1") & F(model__contains = "3850"))
the next day it can be
nornir_object.filter(F(site='site2") & F(model__contains = "2960"))
So now I open the script, write the right filter string, execute scrypt.
Maybe there is an option to send filter string to the script fro outside?
like a string like
'F(site='site2") & F(model__contains = "2960")'
from separate file or something like this
Beta Was this translation helpful? Give feedback.
All reactions