From bc4dcb99a1e12d4d991d668ebec111508dbac487 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 20 Oct 2011 10:51:28 +0200 Subject: [PATCH] test for CLI when using pipe --- PVE/API2/Qemu.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index bc99e80b..957a3988 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -143,7 +143,10 @@ __PACKAGE__->register_method({ PVE::QemuServer::add_random_macs($param); } else { my $keystr = join(' ', keys %$param); - raise_param_exc({ archive => "option conflicts with other options ($keystr)"}) if $keystr; + raise_param_exc({ archive => "option conflicts with other options ($keystr)"}) if $keystr; + + die "pipe requires cli environment\n" + if $archive eq '-' && $rpcenv->{type} ne 'cli'; } my $restorefn = sub {