-
Notifications
You must be signed in to change notification settings - Fork 24
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
Migrate NETCONF junos_helper to provider. #35
Migrate NETCONF junos_helper to provider. #35
Conversation
…copying go files in subdirectories well preserving the pathing during the stage where they are copied to the `providerDir` moved the `config.go` from a file that is copying during processing to a file that is generated during the processing stage, this is so we can properly import subdirectories from the `terraform_providers` directory for example the new `netconf` folder Added in the `netconf` folder, which contains a nearly identical mirror of the `junos_helper` function from `go-netconf`. With the one exception being that the type has been moved to an interface so the possibility of expanding/altering the `netconf` portion is more accessible, this changed also required a change to the generated `provider.go` file to reference the new `netconf` helper.
I know from comments made by @davedotdev that the idea is to keep this Right now, you are modifying multiple libraries if you want to implement a solution to #31 . This PR will make it so that we only need to alter the single |
This has been updated to work with the latest sdk changes. |
…her quality of life issues the main purprose of this commit is to simply remove functions from the file that are not needed for the provider by doing this it allows for a clener ingreation and makes future changes easier to manage
The latest changes to the PR clean up the I have removed functions that are not needed for the operation of jtaf and I have condensed the |
@ydnath - Just tagging you on this for a review. |
The purpose of this pull request is to migrate the
junos_helpers
functionality fromgo-netconf
to this project, it is still using thego-netconf
library but instead of depending upon thejunos_helpers
from the library we simply implement it within this repo.This should allow for easier changes to the NETCONF calls that are being used from this provider while preventing any unwanted changes to the underlying libraries helper such as adding in a bulk/batch mode etc.
To accomplish this I have made the following notable changes.
The
terraform_providers
directory now contains anetconf
directory, this is essentially a like for like copy of thejunos_helpers
file fromgo-netconf
with the exception that we now return an interface structure, the reason for this is so that we can add or remove more helper files as long as it satisfies the interface requirements.The
config.go
library has been moved from theterraform_providers
directory and is now a generated resource, the purpose for this is so that we can correctly import and use any subdirectories within theterraform_providers
directory eg: thenetconf
directoryThe function which copies files from the
terraform_providers
has been updated to also copy files within subdirectories while maintaining the proper pathing, I also added in some logging to the terminal around the files that have been copied over.when generating the
provider.go
file it now has the pathing to the localnetconf
library added in.