diff options
author | Thomas Haller <thaller@redhat.com> | 2018-07-11 08:19:31 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-07-11 12:02:06 +0200 |
commit | b41aa4bfde0a3a72adbda0d6e5e76cf35020e8f5 (patch) | |
tree | c509d3edf0de8e63edf5c20f147378b297850dfd | |
parent | bc2367b83c97a8ef12b6df0ab8fadc6f2d1791f9 (diff) | |
download | NetworkManager-b41aa4bfde0a3a72adbda0d6e5e76cf35020e8f5.tar.gz |
generate-setting-docs.py: remove unreachable code in get_default_value()
get_prop_type() cannot ever return "gchar", because it only returns
values from "dbus_type_name_map" or for enums it has the form
"%s (%s)" % (pspec.value_type.name, prop_type)
Another reason why get_prop_type() cannot ever return a "char" type,
is because of what get_prop_type() does. get_prop_type() only returns
types based on the D-Bus type of the property, and on D-Bus there is
no fundamental type for a one-character string. There is either a
(UTF-8 encoded) string, or integer values of varying sizes. But in
terms of unicode, a 'char' type makes little sense on D-Bus. And neither
does it for get_prop_type().
-rwxr-xr-x | libnm/generate-setting-docs.py | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/libnm/generate-setting-docs.py b/libnm/generate-setting-docs.py index 16d705e867..bb9fa6a133 100755 --- a/libnm/generate-setting-docs.py +++ b/libnm/generate-setting-docs.py @@ -159,8 +159,6 @@ def get_default_value(setting, pspec, propxml): value_type = get_prop_type(setting, pspec) if value_type == 'string' and default_value != '' and pspec.name != 'name': default_value = '"%s"' % default_value - elif value_type == 'gchar' and default_value != '': - default_value = "'%s'" % default_value elif value_type == 'boolean': default_value = str(default_value).upper() elif value_type == 'byte array': |