-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Cisco NSO Proxy Minion #32911
Cisco NSO Proxy Minion #32911
Conversation
- pynso Python module | ||
|
||
|
||
pyVmomi |
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.
Should be PyNSO
, right?
@tonybaloney Thanks for starting this! I had a couple of small comments - mostly doc questions. If @cro could look this over too, that would be great. |
Fixed the various typos. Still not sure about the correct way to expose the other methods. Should these go into a execution module? |
Yes, ideally one writes execution modules that access the proxy module with the |
@cro https://github.com/saltstack/salt/blob/develop/salt/modules/philips_hue.py#L58-L59 woah ok that seems really hacky. What is the appropriate way to do this? Which module should I use as a reference? |
I also recently stumbled on a pattern involving decorators while writing an integration for a customer:
Then if you have execution modules that could be called standalone without a proxy you can decorate functions in there like so:
Then if you just need to call something one-off you can call it from the command line and pass all the connection params. Or if it's being run inside a proxy, it will use the details provided by the decorator. |
Yeah, that is kind of hacky. None of our examples do any metaprogramming like that. The nxos proxy in develop might be a good place to look. |
@cro I've gone with a more explicit approach. This should help with the docstrings being published to the module docs. |
I'd like to get #32792 in before I add tests as well. |
@tonybaloney Did you mean to add three more files to this PR?
I'd like to keep those changes separate so we can review them individually, if you don't mind. That way the people tagged in your test update PR can respond there. It kind of looks like GH is doing something tricky here, but I am not sure. |
@rallytime ooops! reverted |
@cro @rallytime I added a state module for ensuring the configuration of a specific device in the state tree matches a given |
elif __opts__['test'] is True: | ||
ret['result'] = None | ||
ret['comment'] = 'Config will be added' | ||
ret['changes']['new'] = name |
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.
Technically the changes
diction should also have an old
key, too, even if it's an empty string or something. Is it possible to get the current config data and place this is on, compare the difference, and report the new config? I'm not familiar with this service, so it might not be, but though I should at least ask. :)
@tonybaloney OK, I had only one more question/comment. There's also some lint errors that need to be cleaned up. Otherwise I think this looks good. |
@rallytime fixed lint issues and also added a dict compare class to the module to show changes between the actual and the desired states. |
* commit '12a74c24a370e8473bd7b386a911be11577db41c': Cisco NSO Proxy Minion (saltstack#32911) Add caching loader, with msgpack module (saltstack#32953) Make tornado raise error configurable (saltstack#32942)
What does this PR do?
This PR introduces a Proxy Minion for Cisco NSO.
Cisco Network Services Orchestrator (NSO) provides a single pane of glass for orchestrating a multivendor network. To offer support for multivendor devices, it uses network element drivers (NEDs). Traditionally, device adaptors are a major roadblock, since they are not upgraded at the same pace as device interfaces. But adding support for new devices can take months. Cisco NSO NEDs, in contrast, can add new commands and devices in weeks. These drivers also provide extremely fine-grained representation of relevant configuration commands. Using NEDs, NSO also makes device configuration commands available over a networkwide, multivendor command line interface (CLI), APIs, and user interface. In addition, NSO services like VPN can configure a complex multivendor network.
List of devices this enables support for:
Supported devices:
Prime Network Registrar, Quantum, StarOS, UCS ManagWSA
Tests written?
Yes - they live in the github.com/DimesionDataCBUSydney/pynso module package, I will add proxy minion tests too.