mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-19 06:50:07 +03:00
B #2658: GOCA - fix missing error check in Info methods
This commit is contained in:
parent
ee72ee7dad
commit
c9df73133f
@ -138,8 +138,11 @@ func NewImageFromName(name string) (*Image, error) {
|
||||
// Info connects to OpenNebula and fetches the information of the Image
|
||||
func (image *Image) Info() error {
|
||||
response, err := client.Call("one.image.info", image.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
image.body = response.Body()
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
// State looks up the state of the image and returns the ImageState
|
||||
|
@ -126,6 +126,9 @@ func (market *MarketPlace) Rename(newName string) error {
|
||||
// Info retrieves information for the marketplace.
|
||||
func (market *MarketPlace) Info() error {
|
||||
response, err := client.Call("one.market.info", market.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
market.body = response.Body()
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
@ -134,8 +134,11 @@ func (marketApp *MarketPlaceApp) Rename(newName string) error {
|
||||
// Info retrieves information for the marketplace app.
|
||||
func (marketApp *MarketPlaceApp) Info() error {
|
||||
response, err := client.Call("one.marketapp.info", marketApp.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
marketApp.body = response.Body()
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
// Lock locks the marketplace app depending on blocking level.
|
||||
|
@ -143,6 +143,9 @@ func (sg *SecurityGroup) Rename(newName string) error {
|
||||
// Info retrieves information for the security group.
|
||||
func (sg *SecurityGroup) Info() error {
|
||||
response, err := client.Call("one.secgroup.info", sg.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sg.body = response.Body()
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
@ -80,8 +80,11 @@ func CreateTemplate(template string) (uint, error) {
|
||||
// Info connects to OpenNebula and fetches the information of the Template
|
||||
func (template *Template) Info() error {
|
||||
response, err := client.Call("one.template.info", template.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
template.body = response.Body()
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
// Update will modify the template. If appendTemplate is 0, it will
|
||||
|
@ -81,8 +81,11 @@ func CreateVirtualRouter(tpl string) (uint, error) {
|
||||
// Info connects to OpenNebula and fetches the information of the VirtualRouter
|
||||
func (vr *VirtualRouter) Info() error {
|
||||
response, err := client.Call("one.vrouter.info", vr.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
vr.body = response.Body()
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
// Update will modify the virtual router. If appendVirtualRouter is 0, it will
|
||||
|
@ -585,8 +585,11 @@ func (vm *VM) Action(action string) error {
|
||||
// Info connects to OpenNebula and fetches the information of the VM
|
||||
func (vm *VM) Info() error {
|
||||
response, err := client.Call("one.vm.info", vm.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
vm.body = response.Body()
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
// Update will modify the VM's template. If appendTemplate is 0, it will
|
||||
|
Loading…
x
Reference in New Issue
Block a user