From: Zdenek Kabelac Date: Fri, 23 May 2014 21:38:30 +0000 (UTC) Subject: master - vgextend: allow --yes to skip prompt Message-ID: <20140523213830.5CDFC60303@fedorahosted.org> List-Id: To: lvm-devel@redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3f8048f28c45101fde391c3609a97ca116b8e92c Commit: 3f8048f28c45101fde391c3609a97ca116b8e92c Parent: 1a840323229555889184e831000b0c22f273ef66 Author: Zdenek Kabelac AuthorDate: Fri May 23 23:33:17 2014 +0200 Committer: Zdenek Kabelac CommitterDate: Fri May 23 23:35:40 2014 +0200 vgextend: allow --yes to skip prompt --- WHATS_NEW | 1 + tools/vgextend.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 491dece..a2b8af7 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.107 - ================================== + Allow --yes to skip prompt in vgextend (worked only with -f). Don't use name mangling for LVM - it never uses dm names with wrong char set. Remove default.profile and add {command,metadata}_profile_template.profile. Use proper umask for systemd units generated by lvm2-activation-generator. diff --git a/tools/vgextend.c b/tools/vgextend.c index 0c00b7f..2dc1699 100644 --- a/tools/vgextend.c +++ b/tools/vgextend.c @@ -102,9 +102,9 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv) if (arg_count(cmd, metadataignore_ARG) && (vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) && - (pp.force == PROMPT) && + (pp.force == PROMPT) && !pp.yes && yes_no_prompt("Override preferred number of copies " - "of VG %s metadata? [y/n]: ", + "of VG %s metadata? [y/n]: ", vg_name) == 'n') { log_error("Volume group %s not changed", vg_name); goto bad;