On Tue, May 18, 2010 at 02:36:05PM +0200, Michael Hanselmann wrote:
> Signed-off-by: Michael Hanselmann <[email protected]>
> ---
>  lib/cmdlib.py           |  137 ++++++++++++++++++++++++++++++++++++++++------
>  lib/constants.py        |   11 ++++
>  lib/masterd/instance.py |   82 ++++++++++++++++++++++++++++
>  lib/opcodes.py          |   21 +++++++-
>  4 files changed, 232 insertions(+), 19 deletions(-)

LGTM, one comment:

> diff --git a/lib/cmdlib.py b/lib/cmdlib.py
> index a621451..8dbdb27 100644
> --- a/lib/cmdlib.py
> +++ b/lib/cmdlib.py

> +        if not utils.VerifySha1Hmac(cds, "%s:%s:%s" % (idx, host, port),
> +                                    hmac_digest, salt=hmac_salt):
> +          raise errors.OpPrereqError("HMAC for disk %s is wrong" % idx,
> +                                     errors.ECODE_INVAL)

The creation of the message to be signed from the idx/host/port triple
should be abstracted into a separate function, instead of hardcoding it
here and in patch 3/5.

iustin

Reply via email to