Fix for the MAC address configuration

This bug was introduced with the commit d0679f9bb46670c593061c4aaebec2a577cdd5c3
where we enable the support for enabling/disabling the ethernet interface.

This breaks the mac address configuration where during setting of the mac
address requires the device should be down and then write the configuration file.

In write configuration file function, NIC status was checked directly from system
instead of looking at the D-bus values, as the interface was down during setting
of the MAC address, the check for looking at nic enabled status returns false
and it sets the Link status as "unmanged=yes" which stops the systemd-networkd
to configure this interface.

This commit fixes this behaviour by reading the nic status directly from the
D-bus objects.

I don't see a case where D-bus object value and the system given value is
not same as interface down/up is manual action.

TestedBy:
         Configure MAC address
         Configure NIC enabled up/down
         Configure IP address

Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
Change-Id: Ib7c578c06ce930e39c2925d729da4d08c5367899
1 file changed