Assaf Muller has uploaded a new change for review. Change subject: Fixed styling issues. ......................................................................
Fixed styling issues. Change-Id: I0892a80922e354cd73fdaadab1f7a8e18a2d1852 Signed-off-by: Assaf Muller <[email protected]> --- M vdsm_hooks/macspoof/README M vdsm_hooks/macspoof/before_vm_start.py 2 files changed, 9 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/12898/1 diff --git a/vdsm_hooks/macspoof/README b/vdsm_hooks/macspoof/README index e82b2f0..c7d14f6 100644 --- a/vdsm_hooks/macspoof/README +++ b/vdsm_hooks/macspoof/README @@ -1,13 +1,16 @@ macspoof vdsm hook ================================= -This hook goes through all of the VM's interfaces and removes MAC and ARP spoofing filtering. +This hook goes through all of the VM's interfaces and removes +MAC and ARP spoofing filtering. Installation: * Use the engine-config to append the appropriate custom property as such: - sudo engine-config -s UserDefinedVMProperties='previousProperties;macspoof=^(true|false)$' --cver=3.2 + sudo engine-config -s UserDefinedVMProperties= + 'previousProperties;macspoof=^(true|false)$' --cver=3.2 * Verify that the macspoof custom property was properly added: sudo engine-config -g UserDefinedVMProperties Usage: -In the VM configuration window, open the custom properites tab and add macspoof=true +In the VM configuration window, open the custom properites tab +and add macspoof=true diff --git a/vdsm_hooks/macspoof/before_vm_start.py b/vdsm_hooks/macspoof/before_vm_start.py index fde594e..4949f6d 100755 --- a/vdsm_hooks/macspoof/before_vm_start.py +++ b/vdsm_hooks/macspoof/before_vm_start.py @@ -16,8 +16,8 @@ and checks if it's a mac spoofing/ARP spoofing filter """ filterValue = filterElement.getAttribute('filter') - return filterValue == 'vdsm-no-mac-spoofing' or \ - filterValue == 'vdsm-no-arp-mac-spoofing' + return filterValue in ('vdsm-no-mac-spoofing', + 'vdsm-no-arp-mac-spoofing') def removeFilter(interface, filterElement): @@ -30,7 +30,7 @@ def main(): - if 'macspoof' in os.environ and os.environ.get('macspoof') == 'true': + if hooking.tobool(os.environ.get('macspoof')): domxml = hooking.read_domxml() for interface in domxml.getElementsByTagName('interface'): -- To view, visit http://gerrit.ovirt.org/12898 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0892a80922e354cd73fdaadab1f7a8e18a2d1852 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
