Replies: 2 comments
-
I dont think I would remove enter/exit -- I was kinda thinking about (but haven't documented it like this :shame:) using it like this:
This brings up another thing I know we've chatted about -- about making that I also envision using it kinda like this:
I dont think want to have the "open-y" things happening at any time other than an "open" (though perhaps "open" should be renamed as you point out) -- the reason for this is that "open" in scrapli-cfg context actually does things in that it sends configs (ex: All of that said -- I think you are right that it is probably overly confusing.... so either something needs to change or docs need to get better (which needs to happen anyway, just kinda early days for this still at the moment). Whatchya think? |
Beta Was this translation helpful? Give feedback.
-
made some changes and updated docs/examples/readme to reflect this.... the cliff notes version:
Phew.... I think this conversation has made things better.... hopefully you agree! still have a few months until the first "real" (non pre) release, so defo time to dial things in! |
Beta Was this translation helpful? Give feedback.
-
Currently it is slightly confusing, since the only "real" connection is scrapli one, however we have double
open
and then close on ScrapliCfgPlatform side. It becomes even more confusing when the intention is to use it with a context manager. E.g. currently I am using:I think it would be possible to remove
open()
andclose()
, as well as__enter__
and__exit__
methods onScrapliCfgPlatform
and have some special commands that needs to be sent moved to a separate method (e.g.prepare
). A method like this could implicitly be called when we callrender_substituted_config
orload_config
(not sure about this, just an idea).Beta Was this translation helpful? Give feedback.
All reactions