mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 18:40:16 +01:00
libnm-core/utils: allow use of bytestring with attributes
(cherry picked from commit 18dd937b81)
This commit is contained in:
parent
1a41724998
commit
595a06b689
1 changed files with 4 additions and 0 deletions
|
|
@ -5550,6 +5550,8 @@ nm_utils_parse_variant_attributes (const char *string,
|
|||
variant = g_variant_new_boolean (b);
|
||||
} else if (g_variant_type_equal ((*s)->type, G_VARIANT_TYPE_STRING)) {
|
||||
variant = g_variant_new_take_string (g_steal_pointer (&value));
|
||||
} else if (g_variant_type_equal ((*s)->type, G_VARIANT_TYPE_BYTESTRING)) {
|
||||
variant = g_variant_new_bytestring (value);
|
||||
} else {
|
||||
g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_FAILED,
|
||||
_("unsupported attribute '%s' of type '%s'"), (*s)->name,
|
||||
|
|
@ -5618,6 +5620,8 @@ nm_utils_format_variant_attributes (GHashTable *attributes,
|
|||
value = g_variant_get_boolean (variant) ? "true" : "false";
|
||||
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING))
|
||||
value = g_variant_get_string (variant, NULL);
|
||||
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_BYTESTRING))
|
||||
value = g_variant_get_bytestring (variant);
|
||||
else
|
||||
continue;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue