« Previous | Next » 

Revision f4d377e7

IDf4d377e7fe5989b2102e7d8712b8e19c1fcd163b
Parent 8d75db10
Child d87ae7d2

Added by Iustin Pop about 16 years ago

Make backend._GetVGInfo check the validity of 'vgs'

Currently, the function backend._GetVGInfo only checks for errors via
the exit code of the 'vgs' command. However, there are other ways of
failure so we need to also check for valid output before parsing.

Furthermore, the checks on the exit code were reported via a 'raise
LVMError', however this exception is not handled anywhere and so the
remote caller will not get reasonable data.

This patch does two main things:
- change the calling protocol for this function to not raise an error,
and instead return the same type of argument always (dict) with the
requested keys but values changed into None; this allows in the
parent rpc call node_info to have valid memory information but
"error" value for disk space, if there's an error with disks
- check the validity of the output so that in case we fail to parse
it, we don't abort with a backtrace in the node daemon but instead
return the default result value (containing errors), and log these
cases in the node daemon log file

We also bump the protocol version to 11.

Reviewed-by: ultrotter

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences