Skip to content
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

dconf: three minor but useful fixes #6206

Merged
merged 3 commits into from
Apr 13, 2023

Commits on Mar 30, 2023

  1. dconf: Correctly handle setting a key that has no value in DB

    We need to check if the value in the database is None before we try to
    parse it, because the GVariant parser won't accept None as an input
    value. By definition if the value is None, i.e., there's no value in
    the database, than any value the user is trying to set is a change, so
    just indicate that it's a change without trying to compare the None to
    whatever the user specified as the value.x
    jikamens committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    755b013 View commit details
    Browse the repository at this point in the history
  2. dconf: Give a more useful error when writing a key fails

    if writing a key fails, then include in the error that is returned the
    exact key and value aguments that were given to the dconf command, to
    assist in diagnosing failures caused by providing the key or value in
    the wrong format.x
    jikamens committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    d573cfc View commit details
    Browse the repository at this point in the history
  3. dconf: Convert boolean values into the format that dconf expects

    Even though we warn users to be careful to specify GVariant strings
    for values, a common error is to be trying to specify a boolean string
    which ends up getting converted into a boolean by the YAML parser or
    Ansible. Then it gets converted to "True" or "False", the string
    representations of Python booleans, which are not valid GVariants.
    
    Rather than just failing with an obscure error when this happens,
    let's be more user-friendly and detect when the user has specified a
    boolean and convert it into the correct GVariant forms, "true" or
    "false", so it just works. There's no good reason to be more pedantic
    than that.
    jikamens committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    a37589c View commit details
    Browse the repository at this point in the history