Merge lp:~codehelp/lava-dispatcher/multinode into lp:lava-dispatcher/multinode
Status: | Merged |
---|---|
Approved by: | Neil Williams |
Approved revision: | 684 |
Merged at revision: | 659 |
Proposed branch: | lp:~codehelp/lava-dispatcher/multinode |
Merge into: | lp:lava-dispatcher/multinode |
Diff against target: |
121 lines (+27/-22) 1 file modified
lava/dispatcher/group.py (+27/-22) |
To merge this branch: | bzr merge lp:~codehelp/lava-dispatcher/multinode |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Fu Wei | Approve | ||
Linaro Automation & Validation | Pending | ||
Review via email: mp+174612@code.launchpad.net |
Description of the change
This is the reworking of the group key=value pair handling done at Connect and which complements Fu's change for wait_all.
This results in:
<LAVA_WAIT_
<LAVA_WAIT_
<LAVA_MULTI_NODE> <LAVA_WAIT_ALL get_source client>
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
<LAVA_DISPATCHE
The output sent from the GroupDispatcher is:
{
"kvm01": {
"source": "kvm01",
"role": "client"
},
"kvm02": {
"source": "kvm02",
"role": "client"
}
}
This converts to a message of:
kvm01:source=kvm01 kvm01:role=client kvm02:source=kvm02 kvm02:role=client
There's a parallel change in signals/__init__.py which goes along with this change:
=== modified file 'lava_dispatche r/signals/ __init_ _.py' /signals/ __init_ _.py 2013-07-10 10:36:36 +0000 /signals/ __init_ _.py 2013-07-16 08:14:35 +0000 transport( json.dumps( msg))
logging. debug(" Node transport replied with %s" % reply)
message_ str = ""
self. connection. sendline( "<LAVA_ WAIT_COMPLETE% s>" % message_str)
--- lava_dispatcher
+++ lava_dispatcher
@@ -207,8 +207,11 @@
reply = self.context.
- for key, value in reply[0].items():
- message_str += " %s=%s" % (key, value)
+ for target, messages in reply.items():
+ for key, value in messages.items():
+ message_str += " %s:%s=%s" % (target, key, value)
+# for key, value in reply[0].items():
+# message_str += " %s=%s" % (key, value)
def _on_WAIT_ALL(self, message_id, role=None):
With this change, lava-wait gives this kind of output:
<LAVA_DISPATCHE R>2013- 07-16 08:37:18 AM DEBUG: Node transport replied with localdomain" arndale01" : { localdomain"
{
"panda21": {
"ip": "192.168.23.11",
"hostname": "panda21.
},
"multinode-
"ip": "192.168.1.79"
},
"panda19": {
"ip": "192.168.127.216",
"hostname": "panda19.
}
}
<LAVA_DISPATCHE R>2013- 07-16 08:37:18 AM DEBUG: send : <LAVA_WAIT_COMPLETE ip=192. 168.23. 11 hostname= panda21. localdomain
panda21:
panda21:
multinode- arndale01: ip=192. 168.1.79
panda19: ip=192. 168.127. 216 hostname= panda19. localdomain
panda19:
>