Closed erik78se closed 9 months ago
This is very surprising, are you sure the current controller was 2.9
? Note that just having the controller bootstrapped is not enough for that example to work, it actually need to be juju switch
ed onto that controller (i.e. example connects to the "current" controller).
I'll try to reproduce this in a moment and note here what I see 👍
Yeah it seems to be working with the 2.9
track of libjuju. I see:
$ python examples/connect_current_model.py
There are 0 applications
Disconnecting from model
$
So I'll go ahead and close this. But please do try again (making sure using one of pylibjuju 2.9 track releases -- the latest 2.9.46 should work fine) and feel free to re-open if the issue persists 👍
I guess the problem might be related to the fact that the examples all have a hard requirement of having the full juju client on the right version installed.
I also have issues with self signed certificates.
There is also a bug/feature which also require a user to be admin, or a connect() to a controller will fail.
It would be great if the examples worked under less tight circumstances.
I guess the problem might be related to the fact that the examples all have a hard requirement of having the full juju client on the right version installed.
That requirement is for using pylibjuju in general, not specific to the examples. Currently you have to use pylibjuju 2.9 vs a juju 2.9 controller and similarly a 3.x pylibjuju for 3.x juju. I'm working on a side branch that'll merge these two tracks, but until then the right track is needed for running pylibjuju, including the code in the examples.
I also have issues with self signed certificates.
Yeah I bumped into that one this morning, reported in #1001
There is also a bug/feature which also require a user to be admin, or a connect() to a controller will fail.
I believe you're talking about #998, I also commented there as well, fix coming for that soon 👍
It would be great if the examples worked under less tight circumstances.
Same as above, that's a requirement on pylibjuju, not fundamental to the examples. (i.e. the same example working with 2.9 pylibjuju against a 2.9 juju controller should also work the same with a 3.x pylibjuju against a 3.x juju controller).
I guess the problem might be related to the fact that the examples all have a hard requirement of having the full juju client on the right version installed.
That requirement is for using pylibjuju in general, not specific to the examples. Currently you have to use pylibjuju 2.9 vs a juju 2.9 controller and similarly a 3.x pylibjuju for 3.x juju. I'm working on a side branch that'll merge these two tracks, but until then the right track is needed for running pylibjuju, including the code in the examples.
I have managed to use the lib without the client installed. The only thing I did was to make a controllers.yaml file and populated it with information about the endpoints.
I think this would be alot better than having to install the client which at least makes the lib independent from the client which makes absolutely no sense if we are to be able to use this lib with automation tools. Why not just make the call to the connect client dependent on some auth parameters which is in the credentials.yaml ?
I believe the lib currently reads ~/.local/share/controllers.yaml if you
don't specify information about what controller to connect to, but you can
(or at least should) be able to use the library without juju
installed
as long as you specify all the information that we would have otherwise
pulled in.
I've been encouraging to make that more clearly separated (eg Model must
always take the full description of how it should be instantiated, but
there is a clear helper function that can read ~/.local/share if you want
to use it.)
John =:->
On Mon, Jan 8, 2024 at 6:21 PM Erik Lönroth @.***> wrote:
I guess the problem might be related to the fact that the examples all have a hard requirement of having the full juju client on the right version installed.
That requirement is for using pylibjuju in general, not specific to the examples. Currently you have to use pylibjuju 2.9 vs a juju 2.9 controller and similarly a 3.x pylibjuju for 3.x juju. I'm working on a side branch that'll merge these two tracks, but until then the right track is needed for running pylibjuju, including the code in the examples.
I have managed to use the lib without the client installed. The only thing I did was to make a controllers.yaml file and populated it with information about the endpoints.
I think this would be alot better than having to install the client which at least makes the lib independent from the client which makes absolutely no sense if we are to be able to use this lib with automation tools. Having to install the juju client just to get access to the controllers.yaml doesn't make any sense.
— Reply to this email directly, view it on GitHub https://github.com/juju/python-libjuju/issues/995#issuecomment-1881974174, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABRQ7MDK33CVJ4YABEBGADYNR5N5AVCNFSM6AAAAABAXZXSXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBRHE3TIMJXGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Yes the files that come with the juju client are used to make things convenient (e.g. allows you to just call Model().connect()
that takes care of all the creds, endpoints etc for the connection behind the scenes), but they should never be required. Pylibjuju can certainly be used without the juju cli installed by providing all the details of the connection. I mentioned this on the matrix as well, we actively work on removing any code that accidentally depends on the juju cli (e.g. https://github.com/juju/python-libjuju/pull/984), so any dependency that's caught in between pylibjuju and the juju cli should be raised as a bug for sure.
any dependency that's caught in between pylibjuju and the juju cli should be raised as a bug for sure.
That is good to know. I will raise bugs whenever I find it. A simple search for the "*.yaml" in the source-tree might find more. Thanx for responding.
A simple search for the "*.yaml" in the source-tree might find more.
I'd like to note again, the extra information that come with the juju cli (e.g., the yaml files, env variables) are continued to be used within the library's normal operation (because they make things convenient for the -client- part of the library, if they exist), so it is plausible that you'd see some static references to those resources within the code. However, as you rightfully mentioned before as well, no operation should depend on their (nor the juju cli's) existence.
Description
I was trying to run the example when it blew up.
Urgency
Annoying bug in our test suite
Python-libjuju version
2.9.46.0
Juju version
2.9.46
Reproduce / Test