[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH 2/2] sysprep: Remove the data of dovecot



On Fri, Apr 27, 2012 at 02:18:53PM +0800, Wanlong Gao wrote:
> Remove the data of dovecot.
> 
> Signed-off-by: Wanlong Gao <gaowanlong cn fujitsu com>
> ---
>  sysprep/Makefile.am                       |    2 ++
>  sysprep/sysprep_operation_dovecot_data.ml |   43 +++++++++++++++++++++++++++++
>  2 files changed, 45 insertions(+)
>  create mode 100644 sysprep/sysprep_operation_dovecot_data.ml
> 
> diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
> index e2b4806..2424071 100644
> --- a/sysprep/Makefile.am
> +++ b/sysprep/Makefile.am
> @@ -37,6 +37,7 @@ SOURCES = \
>  	sysprep_operation_cron_spool.ml \
>  	sysprep_operation_dhcp_client_state.ml \
>  	sysprep_operation_dhcp_server_state.ml \
> +	sysprep_operation_dovecot_data.ml \
>  	sysprep_operation_flag_reconfiguration.ml \
>  	sysprep_operation_hostname.ml \
>  	sysprep_operation_logfiles.ml \
> @@ -67,6 +68,7 @@ OBJECTS = \
>  	sysprep_operation_cron_spool.cmx \
>  	sysprep_operation_dhcp_client_state.cmx \
>  	sysprep_operation_dhcp_server_state.cmx \
> +	sysprep_operation_dovecot_data.cmx \
>  	sysprep_operation_flag_reconfiguration.cmx \
>  	sysprep_operation_hostname.cmx \
>  	sysprep_operation_logfiles.cmx \
> diff --git a/sysprep/sysprep_operation_dovecot_data.ml b/sysprep/sysprep_operation_dovecot_data.ml
> new file mode 100644
> index 0000000..bf01ef4
> --- /dev/null
> +++ b/sysprep/sysprep_operation_dovecot_data.ml
> @@ -0,0 +1,43 @@
> +(* virt-sysprep
> + * Copyright (C) 2012 FUJITSU LIMITED
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + *)
> +
> +open Sysprep_operation
> +
> +module G = Guestfs
> +
> +let dovecot_data_perform g root =
> +  let typ = g#inspect_get_type root in
> +  if typ <> "windows" then (
> +    let files = g#glob_expand "/var/lib/dovecot/*" in
> +    Array.iter (
> +      fun file -> try g#rm file with G.Error _ -> ()
> +    ) files;
> +    []
> +  )
> +  else []
> +
> +let dovecot_data_op = {
> +  name = "dovecot-data";
> +  enabled_by_default = true;
> +  heading = "Remove the data of dovecot";
> +  pod_description = None;
> +  extra_args = [];
> +  perform = dovecot_data_perform;
> +}
> +
> +let () = register_operation dovecot_data_op
> -- 
> 1.7.10

ACK.

I'll push these later on, thanks.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]