diff --git a/include/RequestManager.h b/include/RequestManager.h index fcf0987e13..d6df90ff53 100644 --- a/include/RequestManager.h +++ b/include/RequestManager.h @@ -797,7 +797,7 @@ private: upool(_upool) { _signature="A:sib"; - _help="Removes image attribute"; + _help="Publish/Unpublish the Image"; }; ~ImagePublish(){}; @@ -822,7 +822,7 @@ private: upool(_upool) { _signature="A:sib"; - _help="Removes image attribute"; + _help="Enables/Disables the Image"; }; ~ImageEnable(){}; diff --git a/src/oca/ruby/OpenNebula/Image.rb b/src/oca/ruby/OpenNebula/Image.rb index d18492efaf..5c26f36b2f 100644 --- a/src/oca/ruby/OpenNebula/Image.rb +++ b/src/oca/ruby/OpenNebula/Image.rb @@ -73,7 +73,7 @@ module OpenNebula end def remove_attr(name) - super(IMAGE_METHODS[:rmattr], name) + do_rm_attr(name) end def enable @@ -143,11 +143,20 @@ module OpenNebula def set_publish(published) return Error.new('ID not defined') if !@pe_id - rc = @client.call(IMAGE_METHODS[:publish], @pe_id, published) + rc = @client.call(IMAGE_METHODS[:publish], @pe_id, publish) rc = nil if !OpenNebula.is_error?(rc) return rc end - + + def do_rm_attr(name) + return Error.new('ID not defined') if !@pe_id + + rc = @client.call(IMAGE_METHODS[:rmattr], @pe_id, name) + rc = nil if !OpenNebula.is_error?(rc) + + return rc + end + end end diff --git a/src/rm/RequestManagerImageEnable.cc b/src/rm/RequestManagerImageEnable.cc index 04a30316ff..cdeafff1ec 100644 --- a/src/rm/RequestManagerImageEnable.cc +++ b/src/rm/RequestManagerImageEnable.cc @@ -74,7 +74,7 @@ void RequestManager::ImageEnable::execute( if ( rc < 0 ) { - goto error_remove_attribute; + goto error_enable; } @@ -106,7 +106,7 @@ error_authorization: " attributes, aborting call."; goto error_common; -error_remove_attribute: +error_enable: oss << "[ImageEnable] Cannot enable/disable image [" << iid << "]"; goto error_common;