Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
OpenNebulaProject opened this issue Nov 20, 2017 · 2 comments
Closed

Comments

@OpenNebulaProject
Copy link


Author Name: Anton Todorov (Anton Todorov)
Original Redmine Issue: 5443, https://dev.opennebula.org/issues/5443
Original Date: 2017-10-06


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

@OpenNebulaProject
Copy link
Author


Original Redmine Comment
Author Name: Anton Todorov (Anton Todorov)
Original Date: 2017-10-06T19:46:48Z


Pull request #522

#522

BR,
Anton

@rsmontero
Copy link
Member

Already merge thanks

rsmontero pushed a commit that referenced this issue Aug 3, 2021
(cherry picked from commit 0dc47dc1b4912df5c91090867829d411de2da3cd)
atodorov-storpool pushed a commit to storpool/one that referenced this issue Aug 3, 2021
(cherry picked from commit 0dc47dc1b4912df5c91090867829d411de2da3cd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants