Closed aaronchar closed 1 year ago
I know from comments made by @davedotdev that the idea is to keep this jtaf
library as simple as possible,I think the added flexibility that is gained by moving a core dependency from an external library into the provider library allows greater flexibility as well as potential customization at a user level.
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 jtaf
NETCONF interface.
This has been updated to work with the latest sdk changes.
The latest changes to the PR clean up the NETCONF
helper functions.
I have removed functions that are not needed for the operation of jtaf and I have condensed the destroy
operations to a single function instead of destroyNoCommit
and destory
, this is now a single destroy
function that takes a bool commit
variables.
@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.