diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-10-10 10:04:06 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-11-22 10:18:26 +0100 |
commit | e397582cca6e86e14dcf897b182f1136bea1ba64 (patch) | |
tree | eee20e4ae5bd47a7d9b29d68864f44c3176c8e32 /examples | |
parent | 1b90ad41bba08726136b062e61bb59303a9137fa (diff) | |
download | NetworkManager-e397582cca6e86e14dcf897b182f1136bea1ba64.tar.gz |
libnm: export interface flags
Add libnm support for the new InterfaceFlags property of NMDevice.
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/python/gi/get-interface-flags.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/python/gi/get-interface-flags.py b/examples/python/gi/get-interface-flags.py new file mode 100755 index 0000000000..756999169b --- /dev/null +++ b/examples/python/gi/get-interface-flags.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2019 Red Hat, Inc. +# + +import gi +gi.require_version('NM', '1.0') +from gi.repository import GLib, NM + +if __name__ == "__main__": + client = NM.Client.new(None) + devices = client.get_devices() + + for d in devices: + print("{:<16} {:<16} {}".format(d.get_iface(), + "(" + d.get_type_description() + ")", + NM.utils_enum_to_str(NM.DeviceInterfaceFlags, + d.get_interface_flags()))) |