Petr Horáček has uploaded a new change for review.
Change subject: hooks: ovs: add script name to log ......................................................................
hooks: ovs: add script name to log
Change-Id: I8e40406fb2dfce6099a2c288b5d3c37ceec839d1 Signed-off-by: Petr Horáček phoracek@redhat.com --- M vdsm_hooks/ovs/ovs_after_get_stats.py M vdsm_hooks/ovs/ovs_after_network_setup.py M vdsm_hooks/ovs/ovs_after_network_setup_failture.py M vdsm_hooks/ovs/ovs_before_network_setup.py M vdsm_hooks/ovs/ovs_before_network_setup_ip.py M vdsm_hooks/ovs/ovs_before_network_setup_ovs.py M vdsm_hooks/ovs/ovs_utils.py 7 files changed, 31 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/46916/1
diff --git a/vdsm_hooks/ovs/ovs_after_get_stats.py b/vdsm_hooks/ovs/ovs_after_get_stats.py index fc04417..b902f57 100755 --- a/vdsm_hooks/ovs/ovs_after_get_stats.py +++ b/vdsm_hooks/ovs/ovs_after_get_stats.py @@ -17,13 +17,17 @@ # # Refer to the README and COPYING files for full details of the license # +from functools import partial import traceback
from vdsm.netconfpersistence import RunningConfig
import hooking
-from ovs_utils import is_ovs_network, log +from ovs_utils import is_ovs_network +import ovs_utils + +log = partial(ovs_utils.log, tag='ovs_after_get_stats: ')
def ovs_networks_stats(stats): diff --git a/vdsm_hooks/ovs/ovs_after_network_setup.py b/vdsm_hooks/ovs/ovs_after_network_setup.py index 7f99db1..b40e2e6 100644 --- a/vdsm_hooks/ovs/ovs_after_network_setup.py +++ b/vdsm_hooks/ovs/ovs_after_network_setup.py @@ -17,11 +17,15 @@ # # Refer to the README and COPYING files for full details of the license # +from functools import partial import traceback
import hooking
-from ovs_utils import remove_init_config, log +from ovs_utils import remove_init_config +import ovs_utils + +log = partial(ovs_utils.log, tag='ovs_after_network_setup: ')
def main(): diff --git a/vdsm_hooks/ovs/ovs_after_network_setup_failture.py b/vdsm_hooks/ovs/ovs_after_network_setup_failture.py index 9935a13..d79ef84 100755 --- a/vdsm_hooks/ovs/ovs_after_network_setup_failture.py +++ b/vdsm_hooks/ovs/ovs_after_network_setup_failture.py @@ -17,13 +17,16 @@ # # Refer to the README and COPYING files for full details of the license # +from functools import partial import traceback
from vdsm import supervdsm
import hooking
-from ovs_utils import log +import ovs_utils + +log = partial(ovs_utils.log, tag='ovs_after_network_setup_failture: ')
def main(): diff --git a/vdsm_hooks/ovs/ovs_before_network_setup.py b/vdsm_hooks/ovs/ovs_before_network_setup.py index c02c438..9bc73a5 100755 --- a/vdsm_hooks/ovs/ovs_before_network_setup.py +++ b/vdsm_hooks/ovs/ovs_before_network_setup.py @@ -18,6 +18,7 @@ # Refer to the README and COPYING files for full details of the license # from copy import deepcopy +from functools import partial import sys import traceback
@@ -28,7 +29,7 @@ from hooking import execCmd import hooking
-from ovs_utils import (is_ovs_network, is_ovs_bond, load_init_config, log, +from ovs_utils import (is_ovs_network, is_ovs_bond, load_init_config, save_init_config, iter_ovs_nets, suppress, destroy_ovs_bridge, EXT_IP, EXT_OVS_VSCTL) from ovs_setup_ovs import configure_ovs, prepare_ovs @@ -36,11 +37,14 @@ from ovs_setup_mtu import configure_mtu from ovs_setup_libvirt import (create_libvirt_nets, remove_libvirt_nets, prepare_libvirt) +import ovs_utils
# TODO: move required modules into vdsm/lib sys.path.append('/usr/share/vdsm') from network.configurators import libvirt
+log = partial(ovs_utils.log, tag='ovs_before_network_setup: ') +
def _separate_ovs_nets_bonds(nets, bonds, running_config): """ Get a dictionaries of nets and bonds to be handled by OVS hook and diff --git a/vdsm_hooks/ovs/ovs_before_network_setup_ip.py b/vdsm_hooks/ovs/ovs_before_network_setup_ip.py index c87e6d6..2273cc6 100644 --- a/vdsm_hooks/ovs/ovs_before_network_setup_ip.py +++ b/vdsm_hooks/ovs/ovs_before_network_setup_ip.py @@ -17,11 +17,13 @@ # # Refer to the README and COPYING files for full details of the license # +from functools import partial import sys
from vdsm import ipwrapper, sysctl
-from ovs_utils import suppress, log, BRIDGE_NAME +from ovs_utils import suppress, BRIDGE_NAME +import ovs_utils
# TODO: move required modules into vdsm/lib sys.path.append('/usr/share/vdsm') @@ -30,6 +32,8 @@ from network.models import NetDevice, IPv4, IPv6 from network.sourceroute import DynamicSourceRoute
+log = partial(ovs_utils.log, tag='ovs_before_network_setup_ip: ') +
iproute2 = Iproute2()
diff --git a/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py b/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py index d22748a..72c1c23 100644 --- a/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py +++ b/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py @@ -17,20 +17,24 @@ # # Refer to the README and COPYING files for full details of the license # +from functools import partial import sys
from vdsm.netinfo import NetInfo
import hooking
-from ovs_utils import (get_bond_options, is_ovs_bond, iter_ovs_nets, log, +from ovs_utils import (get_bond_options, is_ovs_bond, iter_ovs_nets, iter_ovs_bonds, rget, suppress, destroy_ovs_bridge, BRIDGE_NAME, EXT_OVS_VSCTL) +import ovs_utils
# TODO: move required modules into vdsm/lib sys.path.append('/usr/share/vdsm') from network.configurators import libvirt
+log = partial(ovs_utils.log, tag='ovs_before_network_setup_ovs: ') + VALID_MODES = frozenset(['active-backup', 'balance-tcp', 'balance-slb']) VALID_LACP = frozenset(['active', 'passive', 'off'])
diff --git a/vdsm_hooks/ovs/ovs_utils.py b/vdsm_hooks/ovs/ovs_utils.py index d592b8f..916909c 100644 --- a/vdsm_hooks/ovs/ovs_utils.py +++ b/vdsm_hooks/ovs/ovs_utils.py @@ -120,8 +120,8 @@ raise Exception('\n'.join(err))
-def log(message): - hooking.log('OVS: %s' % message) +def log(message, tag='OVS: '): + hooking.log('%s%s' % (tag, message))
def load_init_config():
automation@ovirt.org has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Petr Horáček has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 2: Verified+1
Passed functional/networkTestsOVS.py.
logged ok 'ovs_before_network_setup: No needed OVS changes to be done.'
automation@ovirt.org has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Ido Barkan has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 3: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 3: Code-Review+2
raising Ido's score
automation@ovirt.org has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Ido Barkan has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 4: Code-Review+1
was this a rebase? if so then regiving +1
Ido Barkan has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 4: Code-Review-1
(1 comment)
just for visibility (found a possible glitch on ovs_before_network_setup_ovs.py), other then that, it's okay.
https://gerrit.ovirt.org/#/c/46916/4/vdsm_hooks/ovs/ovs_before_network_setup... File vdsm_hooks/ovs/ovs_before_network_setup_ovs.py:
Line 129: vlan abusing this patch for letting you know that this parameter isn't used- is this a bug? or just a forgotten parameter?
Petr Horáček has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 4:
(1 comment)
https://gerrit.ovirt.org/#/c/46916/4/vdsm_hooks/ovs/ovs_before_network_setup... File vdsm_hooks/ovs/ovs_before_network_setup_ovs.py:
Line 125: libvirt.removeNetwork(net) Line 126: return commands Line 127: Line 128: Line 129: def _add_nic_port(net, vlan, nic, nets_by_nic):
abusing this patch for letting you know that this parameter isn't used- is
i will solve it in a separate patch Line 130: if nic in nets_by_nic: Line 131: nets_by_nic[nic].add(net) Line 132: else: Line 133: nets_by_nic[nic] = set([net])
automation@ovirt.org has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 5:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 6:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Ido Barkan has posted comments on this change.
Change subject: hooks: ovs: add script name to log ......................................................................
Patch Set 6: Code-Review+1
vdsm-patches@lists.fedorahosted.org