[sos-devel] [PATCH v3] Patch sos plugin for rhev

Christy Perez christy at linux.vnet.ibm.com
Thu Dec 11 15:53:13 UTC 2014


Sorry. Sent this patch from the wrong branch. Please disregard.

On 12/11/2014 09:48 AM, Christy Perez wrote:
> Until there is a community sos plugin for kimchi, this gathers
> kimichi logs and config information.
> 
> The original internal plugin had a section to capture virsh
> pool info, but that is duplicating the libvirt logs and xml files
> gathered by the libvirt plugin. Removing this also takes care
> of the issue that when running on RHEV, virsh commands should
> use the --read-only flag.
> 
> Signed-off-by: Christy Perez <christy at linux.vnet.ibm.com>
> ---
>  src/kimchi/sos.py | 27 +++++++++++++--------------
>  1 file changed, 13 insertions(+), 14 deletions(-)
> 
> diff --git a/src/kimchi/sos.py b/src/kimchi/sos.py
> index 8a0e34a..2b2b7cb 100644
> --- a/src/kimchi/sos.py
> +++ b/src/kimchi/sos.py
> @@ -12,26 +12,25 @@
>  ## along with this program; if not, write to the Free Software
>  ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> 
> -
>  from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin
> -from sos.utilities import sos_get_command_output
> 
>  class Kimchi(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin):
>      """kimchi-related information
>      """
> 
>      plugin_name = 'kimchi'
> +    packages = ('kimchi',)
> +
> +    option_list = [('log_limit', 'maximum size (MiB) of each log file',
> +                    '', 15)]
> 
>      def setup(self):
> -        self.add_copy_specs([
> -            "/etc/kimchi/",
> -            "/var/log/kimchi*"
> -        ])
> -        self.add_cmd_output("virsh pool-list --details")
> -        rc, out, _ = sos_get_command_output('virsh pool-list')
> -        if rc == 0:
> -            for pool in out.splitlines()[2:]:
> -                if pool:
> -                    pool_name = pool.split()[0]
> -                    self.add_cmd_output("virsh vol-list --pool %s --details"
> -                                        % pool_name)
> +        log_limit = self.get_option('log_limit')
> +        if not self.get_option('all_logs'):
> +            self.add_copy_spec_limit('/var/log/kimchi/*.log', sizelimit=log_limit)
> +            self.add_copy_spec_limit('/etc/kimchi/kimchi*', sizelimit=log_limit)
> +            self.add_copy_spec_limit('/etc/kimchi/distros.d/*.json', sizelimit=log_limit)
> +        else:
> +            self.add_copy_spec('/var/log/kimchi/')
> +            self.add_copy_spec('/etc/kimchi/')
> +                                              
> 




More information about the sos-devel mailing list