Miguel Angel Ajo Pelayo has posted comments on this change.
Change subject: vdsm: allow hooks to pass down dictionaries in json format
......................................................................
Patch Set 6:
(3 comments)
....................................................
File vdsm/configNetwork.py
Line 645: get('bonding') in bondings)
Line 646: raise ConfigNetworkError(ne.ERR_LOST_CONNECTION,
Line 647: 'connectivity check failed')
Line 648:
Line 649: running_config = netconfpersistence.RunningConfig()
Thanks for re-clarifying, this part was yet quite "draft".
If the hook scripts could only be written in python, I'd go the simplest way:
just pass the config request to the hook, and if it does need it he can
retrieve the running config using the vdsm lib.
But considering non-python scripts which can't make use of the vdsm python
libraries, I think I should better add both things to the JSON dictionary:
{
"request": { "network": {...},
"bondings": {...},
"options":{...}}
"current" : { "network": {...},
"bondings": {...}},
}
Question: Do you think it's a good idea to omit the "current" key when unified
persistence is off to avoid confusion.
Question 2: How do I enable/disable unified persistence, and how do I check if
it's enabled disabled?
Line 650: hooks.after_network_setup({'networks': running_config.networks,
Line 651: 'bondings': running_config.bonds})
Line 652:
Line 653:
....................................................
File vdsm/vdsmd.8.in
Line 88: "networks": {"virtnet": {"bonding" : "bond0", "bridged": true,
"vlan":27}},
Line 89: "options": {"conectivityCheck":false}
Line 90: }
Line 91: .fi
Line 92:
Hi, no problem :-)
It wasn't that hard in the end, but educational about VDSM.
So, I will:
1) Remove the arguments explanation (pointing to setupNetworks, I will expand
any doc in setupNetworks if it isn't already there)
2) Keep the creation & removal examples.
3) Reorder the arguments to "networks", "bondings", "options" into the examples.
Line 93: .B bondings specifies any bonding adapter that must be built upon
several
Line 94: physical adapters, or removed when we pass the "remove":true option.
Line 95:
Line 96: .B networks specifies any network that must be setup, and it's
parameters.
Line 158: sent by the caller of the hook. For example if before_nic_hotplug is
called
Line 159: with custom: {qos: '0.5', color: 'red'} then qos and color will be
directly
Line 160: available as environment variables when before_nic_hotplug is called.
Line 161:
Line 162:
Done
Line 163: .SS Hook execution
Line 164: before_vdsm_start and after_vdsm_stop scripts are executed as user
Line 165: .I root.
Line 166: All the other hooks are executed as user
--
To view, visit http://gerrit.ovirt.org/20330
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie07c511e9740fd19a1c27baf87e91f9a427d0dcd
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Miguel Angel Ajo Pelayo <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Miguel Angel Ajo Pelayo <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches