def get_device_mac(run_command_fn, dev_name, netns_name=None):
    """Find device MAC address"""
    if netns_name:
        command_prefix = "ip netns exec %s " % netns_name
    else:
        command_prefix = ""

    (output, _) = run_command_fn("%scat /sys/class/net/%s/address" %
                                 (command_prefix, dev_name))
    return output[0]