Bug #5443

onedb change_body can't update records owned by UID different than 0

Added by Anton Todorov almost 4 years ago. Updated almost 4 years ago.

Status:PendingStart date:10/06/2017
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:CLI
Target version:-
Resolution: Pull request:
Affected Versions:OpenNebula 5.4

Description

Hi,

How to reproduce:
1. Create a VM with user different than 'oneadmin' (uid<>0)
2. Update the VM body. for example change the size of disk 0:

$ onedb change-body vm --id 54 "/VM/TEMPLATE/DISK[DISK_ID=0]/SIZE" $((25*1024)); echo $?
0

3. onedb exits with exit code 0

Result: the VM body element is not updated

Expected behavior: the VM body element should be updated

The cedits for the investigation of the issue should go to Jean-Mark Therond from Iguane Solutions.

Here is a patch that resolves the above example:


--- /usr/lib/one/ruby/onedb/onedb_live.rb.orig    2017-10-06 22:23:30.616440701 +0300
+++ /usr/lib/one/ruby/onedb/onedb_live.rb    2017-10-06 22:23:44.059959332 +0300
@@ -327,7 +327,7 @@
             raise "A value or --delete should specified" 
         end

-        object.info
+        object.info_all

         object.each do |o|
             if options[:id]

Best Regards,
Anton Todorov

Associated revisions

Revision 94823617
Added by Anton Todorov over 3 years ago

B #5443 onedb change_body to lookup in all objects

Revision 4256c467
Added by Anton Todorov over 3 years ago

B #5443 onedb change_body to lookup in all objects

(cherry picked from commit 948236179cab41a6c9fdcf5be86af7301b6869a4)

Revision 88ce6c3d
Added by Anton Todorov over 3 years ago

B #5443 onedb change_body to lookup in all objects

History

Also available in: Atom PDF