From de8c7b78698538423ab145083e40c4c6ad6b5b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Czern=C3=BD?= Date: Wed, 16 Nov 2022 09:27:03 +0100 Subject: [PATCH] F #5516: Dummy drivers for backup (#2350) * Dummy drivers for backup/restore * Sync backup ADMIN rights with oned.conf --- include/RequestManagerVirtualMachine.h | 1 + install.sh | 1 + src/datastore_mad/remotes/dummy/restore | 23 +++++++++++++++++++++++ src/vmm_mad/dummy/one_vmm_dummy.rb | 2 +- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 src/datastore_mad/remotes/dummy/restore diff --git a/include/RequestManagerVirtualMachine.h b/include/RequestManagerVirtualMachine.h index ede45ef172..b940f5e354 100644 --- a/include/RequestManagerVirtualMachine.h +++ b/include/RequestManagerVirtualMachine.h @@ -637,6 +637,7 @@ public: "A:siib") { vm_action = VMActions::BACKUP_ACTION; + auth_op = AuthRequest::ADMIN; } protected: diff --git a/install.sh b/install.sh index a981c59425..86904eac4c 100755 --- a/install.sh +++ b/install.sh @@ -2153,6 +2153,7 @@ DATASTORE_DRIVER_DUMMY_SCRIPTS="src/datastore_mad/remotes/dummy/cp \ src/datastore_mad/remotes/dummy/snap_revert \ src/datastore_mad/remotes/dummy/snap_flatten \ src/datastore_mad/remotes/dummy/rm \ + src/datastore_mad/remotes/dummy/restore \ src/datastore_mad/remotes/dummy/export" DATASTORE_DRIVER_FS_SCRIPTS="src/datastore_mad/remotes/fs/cp \ diff --git a/src/datastore_mad/remotes/dummy/restore b/src/datastore_mad/remotes/dummy/restore new file mode 100755 index 0000000000..23469d0b04 --- /dev/null +++ b/src/datastore_mad/remotes/dummy/restore @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby + +# -------------------------------------------------------------------------- # +# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +#--------------------------------------------------------------------------- # + + + +STDOUT.puts "0 dummy_image" + +exit(0) diff --git a/src/vmm_mad/dummy/one_vmm_dummy.rb b/src/vmm_mad/dummy/one_vmm_dummy.rb index 0943082470..bb168d9c9a 100755 --- a/src/vmm_mad/dummy/one_vmm_dummy.rb +++ b/src/vmm_mad/dummy/one_vmm_dummy.rb @@ -222,7 +222,7 @@ class DummyDriver < VirtualMachineDriver def backup(id, drv_message) result = retrieve_result("backup") - send_message(ACTION[:backup], result, id, 'dummy-backup-id') + send_message(ACTION[:backup], result, id, 'dummy-backup-id 1024') end def poll(id, drv_message)