-
Notifications
You must be signed in to change notification settings - Fork 134
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
Avoid changing default endpoint fixes #346 #347
Avoid changing default endpoint fixes #346 #347
Conversation
Codecov Report
@@ Coverage Diff @@
## master #347 +/- ##
==========================================
+ Coverage 96.83% 96.83% +<.01%
==========================================
Files 12 12
Lines 980 981 +1
Branches 110 110
==========================================
+ Hits 949 950 +1
Misses 12 12
Partials 19 19
Continue to review full report at Codecov.
|
pylxd/client.py
Outdated
else: | ||
path = '/var/lib/lxd/unix.socket' | ||
path = os.path.join( | ||
os.getenv('LXD_DIR', '/var/lib/lxd'), 'unix.socket') |
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.
I'm sorry, but the choose the snap version needs to stay. There is merit in a conversation about whether to check for the /var/lib/lxd/unix.socket
first, and defaulting to that, rather than the snap, but the pylxd library will fail to work in a snap only installed lxd environment which is the default in 18.10 and above (on Ubuntu).
c22a75c
to
2174331
Compare
Signed-off-by: Javier Santacruz <javier.santacruz@avature.net>
2174331
to
97c99ca
Compare
Hi, Thanks for reviewing this. I wasn't aware that the snap installation was about to be the single one. I rewrote the previous commit to look for Thank you! |
Thanks for the update; I'm reviewing and testing this. I think it's probably okay to include this functionality, but I need to check that it works after an lxd.migrate. |
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.
This looks good, and my testing against pkg and snap versions is fine. Thanks for the changes.
When an alternative lxd server is installed via snap, pylxd will change the default to it, effectively
switching from the current server to a different one without the user knowing.
This was making the default value of the Client unreliable as it might change anytime without warning.
Applications relying on the default value of the endpoint for the Client had to be forced now to set
LXD_DIR
to avoid sudden changes when users get a side installation to play with.