-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial pass on refactor #124
Conversation
Co-authored-by: Jeff Kala <48843785+jeffkala@users.noreply.github.com>
74980b1
to
a436455
Compare
Did some testing tonight:
Would think it needs to be modified to something like if credentials:
try:
self.username = credentials.get_secret_value(access_type = SecretsGroupAccessTypeChoices.TYPE_GENERIC, secret_type = SecretsGroupSecretTypeChoices.TYPE_USERNAME)
self.password = credentials.get_secret_value(access_type = SecretsGroupAccessTypeChoices.TYPE_GENERIC, secret_type = SecretsGroupSecretTypeChoices.TYPE_PASSWORD)
try:
secret = credentials.get_secret_value(access_type = SecretsGroupAccessTypeChoices.TYPE_GENERIC, secret_type = SecretsGroupSecretTypeChoices.TYPE_SECRET)
except SecretsGroupAssociation.DoesNotExist:
self.secret = self.password
except SecretsGroupAssociation.DoesNotExist:
# should raise error or also fall back to NAPALM creds?
else:
self.username = settings.NAPALM_USERNAME
self.password = settings.NAPALM_PASSWORD
self.secret = settings.NAPALM_ARGS.get("secret", None) If this is required we'd probably want to document the 'default" secret group access type to use.
Can ssh from the server directly though. Still trying to figure that one out. The job does function properly when using env_vars instead of settings though. |
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks great!
No description provided.