Fix generating last client Id

When the user sets an invalid Address or sets an existing Address and
Port, the correct logic is to return an error but cannot update the
lastClientId.

Tested:
Before:
busctl call xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager xyz.openbmc_project.Network.Client.Create Client sq 192.168.0.1 100
s "/xyz/openbmc_project/network/snmp/manager/1"
busctl call xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager xyz.openbmc_project.Network.Client.Create Client sq 192.168.0.1 100
Call failed: Invalid argument was given.
busctl call xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager xyz.openbmc_project.Network.Client.Create Client sq 192.168.0.2 100
s "/xyz/openbmc_project/network/snmp/manager/3"

With this patch:
busctl call xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager xyz.openbmc_project.Network.Client.Create Client sq 192.168.0.1 100
s "/xyz/openbmc_project/network/snmp/manager/1"
busctl call xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager xyz.openbmc_project.Network.Client.Create Client sq 192.168.0.1 100
Call failed: Invalid argument was given.
busctl call xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager xyz.openbmc_project.Network.Client.Create Client sq 192.168.0.2 100
s "/xyz/openbmc_project/network/snmp/manager/2"

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Icf595e3f0d44a0b807526f084819015dc42cf57c
1 file changed