Return invalid argument error code when assigning IPv6StaticAddreses

Testing the IPv6 IPMI commands identified a situation where Set LAN
Configuration threw an exception. The exception occurred because the
input values supplied to assign an IPv6 Static Address were
invalid. The expectation is that ipmitool would emit a 0xcc (Invalid
input data) error code. The error handler designed to manage any
un-caught exception, is returning the "Unspecified Error" code.

In order to resolve the problem the function call that fails is
wrapped in a try/catch block. The catch looks for the InvalidArgument
exception, and explicitly returns the 0xcc response code. All other
exceptions are rethrown, and will result in the Unspecified Error code
being reported.

The offending command:
The command tries to ENABLE a static IPv6 assignment of ::/0
ipmitool raw 0x0c 0x01 0x01 0x38 0x00 0x80 0x00 0x00 0x00 0x00 0x00 \
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Tested:
Confirmed the offending assignment results in a 0xcc code.
Confirmed a non-matching exception results in a 0xff code.
  Note: This was done by explicitly making the InvalidArgument string
        comparison mismatch. It was not due to observation of an un-caught
        exception.

Change-Id: I3b9590be624ff3a49f12f34bfa66c8aeee7b3b94
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
1 file changed