Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6 from robertbreker/add-travis-ci
Browse files Browse the repository at this point in the history
Add travis CI and gofmt enforcing check.
  • Loading branch information
rdobson committed May 18, 2015
2 parents 0cd58d5 + 7fed55e commit 42dc903
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: go
go:
# Test with the first and the latest go release - to ensure compatibility
- 1
- release
script:
- gofmtresult=$(gofmt -s -l .); if [[ -n $gofmtresult ]]; then echo -e "Please run \"gofmt -s -w .\" before committing for the below:\n$gofmtresult"; false; fi
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/xenserver/go-xenserver-client.svg?branch=master)](https://travis-ci.org/xenserver/go-xenserver-client)

go-xenserver-client
===================

Expand Down
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ func (client *XenAPIClient) Login() (err error) {
if err == nil {
// err might not be set properly, so check the reference
if result["Value"] == nil {
return errors.New ("Invalid credentials supplied")
return errors.New("Invalid credentials supplied")
}
}
}
client.Session = result["Value"]
return err
}
Expand Down Expand Up @@ -351,7 +351,7 @@ func (client *XenAPIClient) CreateNetwork(name_label string, name_description st

net_rec := make(xmlrpc.Struct)
net_rec["name_label"] = name_label
net_rec["name_description"] = name_description
net_rec["name_description"] = name_description
net_rec["bridge"] = bridge
net_rec["other_config"] = make(xmlrpc.Struct)

Expand Down
3 changes: 0 additions & 3 deletions host.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func (self *Host) CallPlugin(plugin, method string, params map[string]string) (r
return
}


func (self *Host) GetAddress() (address string, err error) {
result := APIResult{}
err = self.Client.APICall(&result, "host.get_address", self.Ref)
Expand All @@ -31,7 +30,6 @@ func (self *Host) GetAddress() (address string, err error) {
return address, nil
}


func (self *Host) GetSoftwareVersion() (versions map[string]interface{}, err error) {
versions = make(map[string]interface{})

Expand All @@ -46,4 +44,3 @@ func (self *Host) GetSoftwareVersion() (versions map[string]interface{}, err err
}
return
}

1 change: 0 additions & 1 deletion network.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ func (self *Network) Destroy() (err error) {
}
return
}

11 changes: 5 additions & 6 deletions vdi.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package client

import (
"encoding/xml"
"errors"
"fmt"
log "github.com/Sirupsen/logrus"
"encoding/xml"
"errors"
"fmt"
log "github.com/Sirupsen/logrus"
)

type VDI XenAPIObject
Expand Down Expand Up @@ -51,7 +51,7 @@ func (self *VDI) GetVirtualSize() (virtual_size string, err error) {
if err != nil {
return "", err
}
virtual_size = result.Value.(string)
virtual_size = result.Value.(string)
return virtual_size, nil
}

Expand Down Expand Up @@ -100,7 +100,6 @@ func (self *VDI) SetSharable(value bool) (err error) {
return
}


// Expose a VDI using the Transfer VM
// (Legacy VHD export)

Expand Down
8 changes: 3 additions & 5 deletions vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ func (self *VM) Clone(name_label string) (new_instance *VM, err error) {
return
}


func (self *VM) Copy (new_name string, targetSr *SR) (new_instance *VM, err error) {
func (self *VM) Copy(new_name string, targetSr *SR) (new_instance *VM, err error) {
new_instance = new(VM)

result := APIResult{}
Expand Down Expand Up @@ -489,7 +488,7 @@ func (self *VM) ConnectNetwork(network *Network, device string) (vif *VIF, err e

// Setters

func (self *VM) SetVCpuMax( vcpus uint) (err error) {
func (self *VM) SetVCpuMax(vcpus uint) (err error) {
result := APIResult{}
strVcpu := fmt.Sprintf("%d", vcpus)

Expand All @@ -501,7 +500,7 @@ func (self *VM) SetVCpuMax( vcpus uint) (err error) {
return
}

func (self *VM) SetVCpuAtStartup( vcpus uint) (err error) {
func (self *VM) SetVCpuAtStartup(vcpus uint) (err error) {
result := APIResult{}
strVcpu := fmt.Sprintf("%d", vcpus)

Expand Down Expand Up @@ -593,4 +592,3 @@ func (self *VM) SetHaAlwaysRun(ha_always_run bool) (err error) {
}
return
}

0 comments on commit 42dc903

Please sign in to comment.