Ryan Harper has posted comments on this change. Change subject: move get-conf-item/set-conf-item to vdsm-tool ......................................................................
Patch Set 2: I would prefer that you didn't submit this (6 inline comments) .................................................... File vdsm_reg/vdsm-config Line 5 Line 6 Line 7 Line 8 Line 9 Update this to use /usr/bin/vdsm-tool get-conf-item and avoid modifying the rest of the file. Also, I'm not sure we can rely on the /usr/bin/ path to vdsm-tool. We probably need to create a vdsm-tool value in constants.py and reference that to find out where vdsm-tool is installed. .................................................... File vdsm-tool/get-conf-item.py Line 1: # Copyright 2012 IBM, Inc. Copyright IBM, Corp. 2012 Line 2: # Line 3: # This program is free software; you can redistribute it and/or modify Line 4: # it under the terms of the GNU General Public License as published by Line 5: # the Free Software Foundation; either version 2 of the License, or .................................................... File vdsm-tool/set-conf-item.py Line 1: # Copyright 2012 IBM, Inc. Copyright IBM, Corp. 2012 Line 2: # Line 3: # This program is free software; you can redistribute it and/or modify Line 4: # it under the terms of the GNU General Public License as published by Line 5: # the Free Software Foundation; either version 2 of the License, or Line 35: def set_conf_item(fname, section, item, value): Line 36: """ Line 37: set item to config files Line 38: use this command, comments and item order within config file will be Line 39: destoryed Using this command will change the order of items and comments within the config file. Line 40: Usage: set-conf-item filename.conf section item value Line 41: """ Line 42: vdsmconf.read(fname) Line 43: if not vdsmconf.has_section(section): Line 42: vdsmconf.read(fname) Line 43: if not vdsmconf.has_section(section): Line 44: vdsmconf.add_section(section) Line 45: vdsmconf.set(section, item, value) Line 46: vdsmconf.write(file(fname, 'w')) I suppose vdsmconf will be closed when python exits; any reason not to be explicit and invoke .close() .................................................... File vdsm/vdsmd.init.in Line 38: QCONF=/etc/libvirt/qemu.conf Line 39: LDCONF=/etc/sysconfig/libvirtd Line 40: QLCONF=/etc/libvirt/qemu-sanlock.conf Line 41: Line 42: is_coredump=`/usr/bin/vdsm-tool get-conf-item $CONF_FILE vars core_dump_enable false` I agree with (1). That way we don't have to modify the rest of the file here. Line 43: [ $is_coredump != true ] && is_coredump=false Line 44: Line 45: SYSTEMCTL_SKIP_REDIRECT=true Line 46: -- To view, visit http://gerrit.ovirt.org/7695 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c64de097bbaea6a8cf862b43243377e10e00391 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Bing Bu Cao <[email protected]> Gerrit-Reviewer: Mark Wu <[email protected]> Gerrit-Reviewer: Ryan Harper <[email protected]> Gerrit-Reviewer: ShaoHe Feng <[email protected]> Gerrit-Reviewer: Shu Ming <[email protected]> Gerrit-Reviewer: Wenyi Gao <[email protected]> Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
