Change in vdsm[master]: hooks: Open vSwitch configurator

danken at redhat.com danken at redhat.com
Thu Jul 2 09:58:43 UTC 2015


Dan Kenigsberg has posted comments on this change.

Change subject: hooks: Open vSwitch configurator
......................................................................


Patch Set 43: Code-Review-1

(4 comments)

https://gerrit.ovirt.org/#/c/40312/43/tests/functional/utils.py
File tests/functional/utils.py:

Line 79:         if config.get('vars', 'net_persistence') == 'unified':
Line 80:             self.config = RunningConfig()
Line 81:         else:
Line 82:             self.config = None
Line 83:         self.ovs = '50_ovs' in hooks.installed().get('before_network_setup',
instead of importing hooks.py, the functional test should better use the Vdsm API. getVdsCapabilities reports all installed networks.
Line 84:                                                      {})
Line 85: 
Line 86:     def __getattr__(self, attr):
Line 87:         """


Line 223:         result = self.vdscli.getVdsStats()
Line 224:         if result['status']['code'] == SUCCESS and self.ovs:
Line 225:             # if OVS hook is enabled, rename vlan from 'network-name' to
Line 226:             # 'iface.id', so we are able to use current tests
Line 227:             for network, attrs in result['info']['network'].items():
this massage should take place in after_get_vds_stats.
Line 228:                 if network in self.netinfo.vlans and '.' not in network:
Line 229:                     iface = self.netinfo.vlans[network].get('iface')
Line 230:                     id = self.netinfo.vlans[network].get('vlanid')
Line 231:                     result['info']['network'].update(


Line 251:         return code, msg, vm_list[0]
Line 252: 
Line 253:     def getVdsCapabilities(self):
Line 254:         result = self.vdscli.getVdsCapabilities()
Line 255:         if result['status']['code'] == SUCCESS and self.ovs:
this, too, must take place in the after_get_caps hook
Line 256:             # if OVS hook is enabled, rename vlan from 'network-name' to
Line 257:             # 'iface.id', so we are able to use current tests
Line 258:             for vlan, attrs in result['info']['vlans'].items():
Line 259:                 iface = attrs.get('iface')


https://gerrit.ovirt.org/#/c/40312/43/vdsm_hooks/ovs/ovs_after_get_stats.py
File vdsm_hooks/ovs/ovs_after_get_stats.py:

Line 35:     running_config = RunningConfig()
Line 36: 
Line 37:     for network, attrs in running_config.networks.items():
Line 38:         if rget(attrs, ('custom', 'ovs')):
Line 39:             if attrs.get('vlan') is None:
would be a bit nicer:

 if 'vlan' in attrs
Line 40:                 interface = attrs.get('nic') or attrs.get('bonding')
Line 41:                 ovs_networks_stats[network] = stats[interface]
Line 42: 
Line 43:     hooking.log('Updating network stats with OVS networks: %s' %


-- 
To view, visit https://gerrit.ovirt.org/40312
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id602b6cc87a663424d06c77d1847d2c2d60d289f
Gerrit-PatchSet: 43
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <toni+ovirt at midokura.com>
Gerrit-Reviewer: Barak Azulay <bazulay at gmail.com>
Gerrit-Reviewer: Barak Azulay <bazulay at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list