On Tue, Feb 10, 2009 at 9:17 AM, Iustin Pop <ius...@google.com> wrote:
> On Mon, Feb 09, 2009 at 10:15:54PM +0100, Guido Trotter wrote:
>> On Mon, Feb 9, 2009 at 6:04 PM, Iustin Pop <ius...@google.com> wrote:
>> >
>> > This converts the RPC call blockdev_assemble to the new-style result
>> > format. Note that we won't usually have error information, but it's the
>> > first step toward it.
>> > ---
>> >  lib/backend.py |   16 ++++++++++++----
>> >  lib/cmdlib.py  |   14 ++++++++------
>> >  2 files changed, 20 insertions(+), 10 deletions(-)
>> >
>> > diff --git a/lib/backend.py b/lib/backend.py
>> > index 6e1d039..2c601db 100644
>> > --- a/lib/backend.py
>> > +++ b/lib/backend.py
>> > @@ -1216,10 +1216,18 @@ def BlockdevAssemble(disk, owner, as_primary):
>> >       C{True} for secondary nodes
>> >
>> >   """
>> > -  result = _RecursiveAssembleBD(disk, owner, as_primary)
>> > -  if isinstance(result, bdev.BlockDev):
>> > -    result = result.dev_path
>> > -  return result
>> > +  status = False
>> > +  result = "no error information"
>> > +  try:
>> > +    result = _RecursiveAssembleBD(disk, owner, as_primary)
>> > +    if isinstance(result, bdev.BlockDev):
>> > +      result = result.dev_path
>>
>> Aren't you overloading the meaning of "result" here as discussed this 
>> morning??
>
> Actually no.
>  - ok status: result = a block device path or True
>  - false status: error information
>
> We start by setting it to the error message, and it will be overwritten
> with the correct return value based on status.
>

Ok, LGTM

Thanks,

Guido

Reply via email to