# Path: pyanaconda/constants.py
# DEFAULT_DBUS_TIMEOUT = -1       # use default


from gi.repository import Gio, GLib
from gi.repository import NetworkManager
from pyanaconda.constants import DEFAULT_DBUS_TIMEOUT
import IPy
import struct
import socket
import re
       :type hwaddr: str
       :return: path of settings, None if not found
       :rtype: str or None
    """
    return _find_settings(hwaddr, '802-3-ethernet', 'mac-address',
            format_value=lambda ba: ":".join("%02X" % b for b in ba))

def _find_settings(value, key1, key2, format_value=lambda x:x):
    """Return object path of settings having given value of key1, key2 setting

       :param value: required value of setting
       :type value: corresponds to dbus type of setting
       :param key1: first-level key of setting (eg "connection")
       :type key1: str
       :param key2: second-level key of setting (eg "uuid")
       :type key2: str
       :param format_value: function to be called on setting value before
                            comparing
       :type format_value: function taking one argument (setting value)
       :return: path of settings, None if not found
       :rtype: str or None
    """
    retval = None

    proxy = _get_proxy(object_path="/org/freedesktop/NetworkManager/Settings", interface_name="org.freedesktop.NetworkManager.Settings")

    args = None
    connections = proxy.call_sync("ListConnections",
                                  args,
                                  Gio.DBusCallFlags.NONE,

# Path: pyanaconda/constants.py
# DEFAULT_DBUS_TIMEOUT = -1       # use default


# Path: pyanaconda/nm.py
from gi.repository import Gio, GLib
from gi.repository import NetworkManager
from pyanaconda.constants import DEFAULT_DBUS_TIMEOUT
import IPy
import struct
import socket
import re

       :type hwaddr: str
       :return: path of settings, None if not found
       :rtype: str or None
    """
    return _find_settings(hwaddr, '802-3-ethernet', 'mac-address',
            format_value=lambda ba: ":".join("%02X" % b for b in ba))

def _find_settings(value, key1, key2, format_value=lambda x:x):
    """Return object path of settings having given value of key1, key2 setting

       :param value: required value of setting
       :type value: corresponds to dbus type of setting
       :param key1: first-level key of setting (eg "connection")
       :type key1: str
       :param key2: second-level key of setting (eg "uuid")
       :type key2: str
       :param format_value: function to be called on setting value before
                            comparing
       :type format_value: function taking one argument (setting value)
       :return: path of settings, None if not found
       :rtype: str or None
    """
    retval = None

    proxy = _get_proxy(object_path="/org/freedesktop/NetworkManager/Settings", interface_name="org.freedesktop.NetworkManager.Settings")

    args = None
    connections = proxy.call_sync("ListConnections",
                                  args,
                                  Gio.DBusCallFlags.NONE,

                                  DEFAULT_DBUS_TIMEOUT,