On Thu, Feb 14, 2013 at 4:43 PM, Dimitris Aragiorgis <[email protected]> wrote:
> Hi,
>
> * Guido Trotter <[email protected]> [2013-02-14 15:50:44 +0100]:
>
>> On Thu, Feb 14, 2013 at 3:06 PM, Dimitris Aragiorgis <[email protected]> wrote:
>> > In case there are no tags (None) " ".join(tag) fails. Run that
>> > only in case of existing tags.
>> >
>> > Signed-off-by: Dimitris Aragiorgis <[email protected]>
>> > ---
>> >  lib/objects.py |    3 ++-
>> >  1 file changed, 2 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/lib/objects.py b/lib/objects.py
>> > index 2f90ea5..a13afa5 100644
>> > --- a/lib/objects.py
>> > +++ b/lib/objects.py
>> > @@ -2053,8 +2053,9 @@ class Network(TaggableObject):
>> >      result = {
>> >        "%sNETWORK_NAME" % prefix: self.name,
>> >        "%sNETWORK_UUID" % prefix: self.uuid,
>> > -      "%sNETWORK_TAGS" % prefix: " ".join(self.tags),
>> >      }
>> > +    if self.tags:
>> > +      result["%sNETWORK_TAGS" % prefix] = " ".join(self.tags)
>>
>> self.tags in case of no tags should be an empty list, not "None".
>> Is this not the case for you?
>>
>
> I though that too until I run into that during a:
>
> gnt-instance add  -o snf-image+default ....--net 0:ip=pool,network=test 
> --no-install test2
>
> 2013-02-14 17:39:22,052: ganeti-masterd pid=25696/Jq1/Job20/I_CREATE INFO 
> !!!!! self.tags =  None <type 'NoneType'>
> 2013-02-14 17:39:22,053: ganeti-masterd pid=25696/Jq1/Job20 ERROR Op 1/1: 
> Caught exception in INSTANCE_CREATE(test2)
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/ganeti/jqueue.py", line 1098, in 
> _ExecOpCodeUnlocked
>       timeout=timeout)
> .....
>
>     env.update(nobj.HooksDict("INSTANCE_NIC%d_" % idx))
>   File "/usr/lib/pymodules/python2.6/ganeti/objects.py", line 2057, in 
> HooksDict
>     "%sNETWORK_TAGS" % prefix: " ".join(self.tags),
> TypeError
> 2013-02-14 17:39:22,181: ganeti-masterd pid=25696/ClientReq7 INFO Received 
> job query request for 20
>
> So?
>

Ack, LGTM,

Thanks,

Guido

Reply via email to