-
Notifications
You must be signed in to change notification settings - Fork 702
Settings daemon driver - take 2 #835
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
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
655b023
[settings] Add driver setting
ricab d74cd30
[daemon] Use driver from settings
ricab 7c6f150
[settings] Use separate files for client/daemon
ricab 04a5682
[settings] Use single directory for files
ricab aa21460
[settings] Employ QString/fmtlib integration
ricab 71dc714
[test] Linux-platform test for default driver
ricab 2cd1f97
[test] Linux-platform test explicit qemu driver
ricab 7cd3178
[test] Refactor linux-platform tests
ricab 57f3c3c
[test] Linux-platform test for libvirt driver
ricab 7d11752
[test] Test hyperkit driver unsupported on Linux
ricab 2130d47
[test] Add parameterized unsupported driver tests
ricab db65b04
[test] Extend get/set tests for local.driver
ricab dd7a295
[daemon] Monitor settings file and quit on change
ricab e3cabab
[daemon] Create settings file if absent
ricab 99d9a53
[settings] Use root file for daemon settings
ricab 22cb7dd
[settings] Fix permissions being silently ignored
ricab ddbb7b6
[settings] Improve error message
ricab ae5ad5a
[settings] Use nicer directory for daemon settings
ricab f94047b
[test] Mock libvirt in platform test
ricab cae2185
[test] Extract fake_handle utility
ricab 7781a22
[test] Test that driver env var precedes settings
ricab d5995a8
[daemon] Implement driver env var precedence
ricab b59597f
[daemon] Drop message concatenation
ricab 87e591e
[settings] Use QDir to construct paths
ricab f1e8859
[snap] Configure XDG paths
ricab f9b0008
[snap] Create XDG directories upon launching
ricab d1dd546
[settings] Rename helper function
ricab e441578
[snap] Make daemon config dir available in client
ricab adb9e10
[settings] Use platform-dependent config path
ricab 921bbb1
[daemon] Exit with EXIT_FAILURE on settings change
ricab bda6d55
[settings] Update default dir of daemon config
ricab b76ad25
[settings] Fix silent ignore of permission denied
ricab 39f4402
[daemon] Update exit code on settings change (42)
ricab 5988e92
[settings] Use QDir for file path
ricab 053c155
[daemon] Drop split driver treatment in error msg
ricab 0f6471e
[settings] Improve error messages
ricab 80e629d
[test] Test that unsupported drivers are rejected
ricab 7330309
[settings] Implement synchronous driver rejection
ricab b9617b5
[test] Small test refactoring
ricab f5fb45b
[test] Change `set` cli tests to `key=val` format
ricab 9268774
[test] Test `set` rejects bad key-val format
ricab 1a122b8
[cli] Implement <key>=<val> format handling in set
ricab c65a269
[test] Extract parameterized tests to own class
ricab b240fa0
[test] Test wrong arg num in `get`/`set` cmds
ricab dab7ddd
[cli] Fix argument checking in `set` cmd
ricab e8e3605
[settings] Improve error message
ricab 62166a3
[test] Fix number of arguments in mock expectation
ricab e1dd710
Merge branch 'master' into settings-daemon-driver-take2
ricab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh -e | ||
|
||
. launcher-common.sh | ||
mk_xdg_dirs | ||
|
||
exec "$SNAP/bin/multipass" "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh -e | ||
|
||
. launcher-common.sh | ||
mk_xdg_dirs | ||
|
||
exec "$SNAP/bin/multipass-gui" "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh -e | ||
|
||
mk_xdg_dirs() | ||
{ # need quotes to handle spaces, but then better test for emptiness | ||
for dir in "$XDG_CACHE_HOME" "$XDG_CONFIG_HOME" "$XDG_DATA_HOME"; do | ||
if [ ! -z "$dir" ]; then | ||
mkdir -p "$dir" | ||
fi | ||
done | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 won't block on this, but we'll have to move away from constructing the error message like this later.
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 am not sure what the issue is. Note that
attempted_operation
could be an enum here, representing read and write ops, that we would then turn into string. Thendetail
is a separate phrase. How could I make this friendlier to translation? Perhaps an example of what problems this could cause would help me understand better.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.
Basically what I mean is that "Unable to format settings" may translate to something completely different than "Unable to access settings" depending on language.
Different languages work in very different ways, building a sentence from a set of strings is bound to break at one point or another. It's a discussion to have over beers, though :)
I'm just sensitive to this because I've translated a lot of software over the years and Polish is one of the more complex languages out there so it easily highlights problems in approaches like that.
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 think I understand the idea. To avoid duplication, I think I would then try a more "square" way, e.g. "Unable to operate on settings. Operation: {}; Details: {}". But this might not feel so good for the user... Isn't this the sort of thing that one would do when preparing the code for translation? Preemptively duplicating messages in the code does not feel right to me either.
BTW, the operation here is just "read" or "read/write", "format/access" goes in the second param as a free string.