From 609f649f81a993366b0a9d1815d8092f7f389473 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 12 Jul 2017 16:36:10 +0100 Subject: [PATCH 1/3] misc: Remove unused variables identified by varcheck And add varcheck to the list of linters used on travis runs (with an increased deadline.) ciao-launcher/qemu_test.go:31:5:warning: unused variable or constant imageInfoTestGood (varcheck) ciao-launcher/qemu_test.go:44:5:warning: unused variable or constant imageInfoTestMissingBytes (varcheck) ciao-launcher/qemu_test.go:57:5:warning: unused variable or constant imageInfoTestMissingLine (varcheck) ciao-launcher/qemu_test.go:69:5:warning: unused variable or constant imageInfoTooBig (varcheck) ciao-launcher/qemu_test.go:82:5:warning: unused variable or constant imageInfoBadBytes (varcheck) configuration/configuration_test.go:35:7:warning: unused variable or constant glanceURL (varcheck) ciao-controller/controller_test.go:1918:5:warning: unused variable or constant testClients (varcheck) qemu/qmp_test.go:44:2:warning: unused variable or constant qmpSuccess (varcheck) qemu/qmp_test.go:45:2:warning: unused variable or constant qmpFailure (varcheck) Signed-off-by: Rob Bradford --- .travis.yml | 4 +- ciao-controller/controller_test.go | 1 - ciao-launcher/qemu_test.go | 64 ----------------------------- configuration/configuration_test.go | 1 - qemu/qmp_test.go | 20 ++++----- 5 files changed, 11 insertions(+), 79 deletions(-) diff --git a/.travis.yml b/.travis.yml index 44636a41d..ce44832fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,9 +55,9 @@ script: - sudo docker pull debian - sudo ip link add testdummy type dummy - sudo ip addr add 198.51.100.1/24 dev testdummy - - gometalinter.v1 --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=deadcode ./... + - gometalinter.v1 --deadline=5m --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=deadcode --enable=varcheck ./... - cd _release/bat - - gometalinter.v1 --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=deadcode ./... + - gometalinter.v1 --deadline=5m --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=deadcode --enable=varcheck ./... - cd ../.. - sudo mkdir -p /var/lib/ciao/instances - sudo mkdir -p /var/lib/ciao/data/controller/workloads diff --git a/ciao-controller/controller_test.go b/ciao-controller/controller_test.go index e2209db00..d24afe9e7 100644 --- a/ciao-controller/controller_test.go +++ b/ciao-controller/controller_test.go @@ -1915,7 +1915,6 @@ func TestMapAddressNoPool(t *testing.T) { } } -var testClients []*testutil.SsntpTestClient var ctl *controller var server *testutil.SsntpTestServer var wrappedClient *ssntpClientWrapper diff --git a/ciao-launcher/qemu_test.go b/ciao-launcher/qemu_test.go index af0550e7d..907e04e65 100644 --- a/ciao-launcher/qemu_test.go +++ b/ciao-launcher/qemu_test.go @@ -28,70 +28,6 @@ import ( "time" ) -var imageInfoTestGood = ` -image: /var/lib/ciao/images/clear-8780-cloud.img -file format: qcow2 -virtual size: 865M (907018240 bytes) -disk size: 113M -cluster_size: 65536 -Format specific information: - compat: 1.1 - lazy refcounts: false - refcount bits: 16 - corrupt: false -` - -var imageInfoTestMissingBytes = ` -image: /var/lib/ciao/images/clear-8780-cloud.img -file format: qcow2 -virtual size: 865M -disk size: 113M -cluster_size: 65536 -Format specific information: - compat: 1.1 - lazy refcounts: false - refcount bits: 16 - corrupt: false -` - -var imageInfoTestMissingLine = ` -image: /var/lib/ciao/images/clear-8780-cloud.img -file format: qcow2 -disk size: 113M -cluster_size: 65536 -Format specific information: - compat: 1.1 - lazy refcounts: false - refcount bits: 16 - corrupt: false -` - -var imageInfoTooBig = ` -image: /var/lib/ciao/images/clear-8780-cloud.img -file format: qcow2 -virtual size: 18,446,744,073,710M (18446744073709551615 bytes) -disk size: 113M -cluster_size: 65536 -Format specific information: - compat: 1.1 - lazy refcounts: false - refcount bits: 16 - corrupt: false -` - -var imageInfoBadBytes = ` -image: /var/lib/ciao/images/clear-8780-cloud.img -file format: qcow2 -virtual size: 865M (9aaaa07018240 bytes) -disk size: 113M -cluster_size: 65536 -Format specific information: - compat: 1.1 - lazy refcounts: false - refcount bits: 16 - corrupt: false -` - func genQEMUParams(networkParams []string) []string { baseParams := []string{ "-drive", diff --git a/configuration/configuration_test.go b/configuration/configuration_test.go index 795d92caf..09df8000e 100644 --- a/configuration/configuration_test.go +++ b/configuration/configuration_test.go @@ -32,7 +32,6 @@ const invalidURI = "file://%z invalid uri with spaces" const emptyPathURI = "file://" const keystoneURL = "http://keystone.example.com" -const glanceURL = "http://glance.example.com" const computeNet = "192.168.1.0/24" const mgmtNet = "192.168.1.0/24" const storageURI = "/etc/ciao/configuration.yaml" diff --git a/qemu/qmp_test.go b/qemu/qmp_test.go index 54ec792cd..51058ec26 100644 --- a/qemu/qmp_test.go +++ b/qemu/qmp_test.go @@ -32,17 +32,15 @@ import ( ) const ( - microStr = "50" - minorStr = "6" - majorStr = "2" - micro = 50 - minor = 6 - major = 2 - cap1 = "one" - cap2 = "two" - qmpHello = `{ "QMP": { "version": { "qemu": { "micro": ` + microStr + `, "minor": ` + minorStr + `, "major": ` + majorStr + ` }, "package": ""}, "capabilities": ["` + cap1 + `","` + cap2 + `"]}}` + "\n" - qmpSuccess = `{ "return": {}}` + "\n" - qmpFailure = `{ "error": {}}` + "\n" + microStr = "50" + minorStr = "6" + majorStr = "2" + micro = 50 + minor = 6 + major = 2 + cap1 = "one" + cap2 = "two" + qmpHello = `{ "QMP": { "version": { "qemu": { "micro": ` + microStr + `, "minor": ` + minorStr + `, "major": ` + majorStr + ` }, "package": ""}, "capabilities": ["` + cap1 + `","` + cap2 + `"]}}` + "\n" ) type qmpTestLogger struct{} From b877a59c84c9059a5599387f82d42ebb7fb79de7 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 12 Jul 2017 16:48:24 +0100 Subject: [PATCH 2/3] misc: Remove unused fields identified by structcheck Add structcheck to the list of linters used on travis runs. ciao-cli/event.go:109:2:warning: unused struct field github.com/01org/ciao/ciao-cli.eventDeleteCommand.all (structcheck) ciao-cli/event.go:110:2:warning: unused struct field github.com/01org/ciao/ciao-cli.eventDeleteCommand.tenant (structcheck) ciao-cli/external_ips.go:636:2:warning: unused struct field github.com/01org/ciao/ciao-cli.poolAddCommand.ips (structcheck) ciao-cli/node.go:43:2:warning: unused struct field github.com/01org/ciao/ciao-cli.nodeListCommand.nodeID (structcheck) ciao-controller/client_wrapper_test.go:29:2:warning: unused struct field github.com/01org/ciao/ciao-controller.ssntpClientWrapper.ctl (structcheck) qemu/qmp.go:111:2:warning: unused struct field github.com/01org/ciao/qemu.qmpResult.data (structcheck) ssntp/ssntp_test.go:193:2:warning: unused struct field github.com/01org/ciao/ssntp_test.ssntpClient.evtTracedChannel (structcheck) ssntp/ssntp_test.go:192:2:warning: unused struct field github.com/01org/ciao/ssntp_test.ssntpClient.staTracedChannel (structcheck) ssntp/ssntp_test.go:194:2:warning: unused struct field github.com/01org/ciao/ssntp_test.ssntpClient.errTracedChannel (structcheck) ssntp/server.go:75:2:warning: unused struct field github.com/01org/ciao/ssntp.Server.roleVerify (structcheck) networking/ciao-cnci-agent/client.go:97:2:warning: unused struct field github.com/01org/ciao/networking/ciao-cnci-agent.agentClient.netCh (structcheck) testutil/agent.go:37:2:warning: unused struct field github.com/01org/ciao/testutil.SsntpTestClient.ticker (structcheck) Signed-off-by: Rob Bradford --- .travis.yml | 4 ++-- ciao-cli/event.go | 4 +--- ciao-cli/external_ips.go | 1 - ciao-cli/node.go | 1 - ciao-controller/client_wrapper_test.go | 1 - networking/ciao-cnci-agent/client.go | 1 - qemu/qmp.go | 3 +-- ssntp/server.go | 1 - ssntp/ssntp_test.go | 3 --- testutil/agent.go | 1 - 10 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce44832fa..571b10f95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,9 +55,9 @@ script: - sudo docker pull debian - sudo ip link add testdummy type dummy - sudo ip addr add 198.51.100.1/24 dev testdummy - - gometalinter.v1 --deadline=5m --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=deadcode --enable=varcheck ./... + - gometalinter.v1 --deadline=5m --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=deadcode --enable=varcheck --enable=structcheck ./... - cd _release/bat - - gometalinter.v1 --deadline=5m --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=deadcode --enable=varcheck ./... + - gometalinter.v1 --deadline=5m --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=deadcode --enable=varcheck --enable=structcheck ./... - cd ../.. - sudo mkdir -p /var/lib/ciao/instances - sudo mkdir -p /var/lib/ciao/data/controller/workloads diff --git a/ciao-cli/event.go b/ciao-cli/event.go index 4c6b299f8..8d9b8921a 100644 --- a/ciao-cli/event.go +++ b/ciao-cli/event.go @@ -105,9 +105,7 @@ func (cmd *eventListCommand) run(args []string) error { } type eventDeleteCommand struct { - Flag flag.FlagSet - all bool - tenant string + Flag flag.FlagSet } func (cmd *eventDeleteCommand) usage(...string) { diff --git a/ciao-cli/external_ips.go b/ciao-cli/external_ips.go index 549f6c180..bfbcf82d2 100644 --- a/ciao-cli/external_ips.go +++ b/ciao-cli/external_ips.go @@ -633,7 +633,6 @@ type poolAddCommand struct { Flag flag.FlagSet name string subnet string - ips []string } func (cmd *poolAddCommand) usage(...string) { diff --git a/ciao-cli/node.go b/ciao-cli/node.go index 68b32726f..79cbd07d6 100644 --- a/ciao-cli/node.go +++ b/ciao-cli/node.go @@ -40,7 +40,6 @@ type nodeListCommand struct { network bool all bool cnci bool - nodeID bool template string } diff --git a/ciao-controller/client_wrapper_test.go b/ciao-controller/client_wrapper_test.go index 63952c346..2dd8416c3 100644 --- a/ciao-controller/client_wrapper_test.go +++ b/ciao-controller/client_wrapper_test.go @@ -26,7 +26,6 @@ import ( ) type ssntpClientWrapper struct { - ctl *controller name string realClient controllerClient diff --git a/networking/ciao-cnci-agent/client.go b/networking/ciao-cnci-agent/client.go index 758004cd9..2a13b006e 100644 --- a/networking/ciao-cnci-agent/client.go +++ b/networking/ciao-cnci-agent/client.go @@ -94,7 +94,6 @@ type agentClient struct { ssntpConn db *cnciDatabase cmdCh chan *cmdWrapper - netCh chan struct{} //Used to signal physical network changes } func (client *agentClient) DisconnectNotify() { diff --git a/qemu/qmp.go b/qemu/qmp.go index fc09543f8..b92a71432 100644 --- a/qemu/qmp.go +++ b/qemu/qmp.go @@ -107,8 +107,7 @@ type QMPEvent struct { } type qmpResult struct { - err error - data map[string]interface{} + err error } type qmpCommand struct { diff --git a/ssntp/server.go b/ssntp/server.go index 4acfe0f86..2b10aae76 100644 --- a/ssntp/server.go +++ b/ssntp/server.go @@ -72,7 +72,6 @@ type Server struct { stopped boolFlag stoppedChan chan struct{} role Role - roleVerify bool clientWg sync.WaitGroup forwardRules frameForward diff --git a/ssntp/ssntp_test.go b/ssntp/ssntp_test.go index 18eda9d1f..6668f18be 100644 --- a/ssntp/ssntp_test.go +++ b/ssntp/ssntp_test.go @@ -189,9 +189,6 @@ type ssntpClient struct { cmdTracedChannel chan string cmdDurationChannel chan time.Duration cmdDumpChannel chan struct{} - staTracedChannel chan string - evtTracedChannel chan string - errTracedChannel chan string } func (client *ssntpClient) ConnectNotify() { diff --git a/testutil/agent.go b/testutil/agent.go index 09f4ea379..3eba60abb 100644 --- a/testutil/agent.go +++ b/testutil/agent.go @@ -34,7 +34,6 @@ type SsntpTestClient struct { Name string instances []payloads.InstanceStat instancesLock *sync.Mutex - ticker *time.Ticker UUID string Role ssntp.Role StartFail bool From f92f9bfa9b0267bb3f244ca93838949acea11d86 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 12 Jul 2017 17:10:11 +0100 Subject: [PATCH 3/3] misc: Remove some of the code flagged by unused linter Unfortunately the ununused linter is overzealous with some of the fields that it things are unused as gophercloud relies on their values. So go ahead with the most straightforward removals but do not enable unused on travis builds. ciao-image/datastore/datastore_test.go:28:5:warning: var metaDsTables is unused (U1000) (unused) ciao-controller/api/api_test.go:39:6:warning: func myHostname is unused (U1000) (unused) ciao-cli/identity.go:58:3:warning: field Description is unused (U1000) (unused) ciao-cli/identity.go:59:3:warning: field DomainID is unused (U1000) (unused) ciao-cli/identity.go:60:3:warning: field Enabled is unused (U1000) (unused) ciao-cli/identity.go:62:3:warning: field ParentID is unused (U1000) (unused) ciao-cli/identity.go:63:3:warning: field Links is unused (U1000) (unused) ciao-cli/identity.go:70:3:warning: field Self is unused (U1000) (unused) ciao-cli/identity.go:71:3:warning: field Previous is unused (U1000) (unused) ciao-cli/identity.go:72:3:warning: field Next is unused (U1000) (unused) ciao-cli/identity.go:207:3:warning: field Next is unused (U1000) (unused) ciao-cli/identity.go:208:3:warning: field Previous is unused (U1000) (unused) ciao-cli/identity.go:209:3:warning: field Self is unused (U1000) (unused) ciao-cli/identity.go:213:3:warning: field Description is unused (U1000) (unused) ciao-cli/identity.go:214:3:warning: field DomainID is unused (U1000) (unused) ciao-cli/identity.go:215:3:warning: field Enabled is unused (U1000) (unused) ciao-cli/identity.go:217:3:warning: field Links is unused (U1000) (unused) ciao-cli/identity.go:221:3:warning: field ParentID is unused (U1000) (unused) ciao-cli/main.go:105:6:warning: type action is unused (U1000) (unused) ciao-cli/volume.go:37:6:warning: type customVolumeExt is unused (U1000) (unused) ciao-cli/volume.go:39:2:warning: field customVolumeExt is unused (U1000) (unused) networking/ciao-cnci-agent/network.go:98:8:warning: const maxKey is unused (U1000) (unused) networking/libsnnet/tests/parallel/parallel_test.go:371:6:warning: func dockerNetList is unused (U1000) (unused) networking/libsnnet/tests/parallel/parallel_test.go:379:6:warning: func dockerNetInfo is unused (U1000) (unused) openstack/compute/api.go:308:2:warning: const limit is unused (U1000) (unused) openstack/compute/api.go:309:2:warning: const marker is unused (U1000) (unused) openstack/compute/api.go:312:6:warning: type pager is unused (U1000) (unused) openstack/compute/api.go:313:2:warning: func pager.filter is unused (U1000) (unused) openstack/compute/api.go:314:2:warning: func pager.nextPage is unused (U1000) (unused) openstack/compute/api_test.go:34:6:warning: func myHostname is unused (U1000) (unused) ciao-controller/api.go:72:2:warning: const statusFilter is unused (U1000) (unused) ciao-controller/api.go:75:6:warning: type pager is unused (U1000) (unused) ciao-controller/api.go:76:2:warning: func pager.filter is unused (U1000) (unused) ciao-controller/api.go:77:2:warning: func pager.nextPage is unused (U1000) (unused) ciao-controller/api.go:136:25:warning: func (*nodePager).filter is unused (U1000) (unused) ciao-controller/api.go:198:31:warning: func (*nodeServerPager).filter is unused (U1000) (unused) ciao-controller/controller_test.go:107:6:warning: func addTestTenantNoCNCI is unused (U1000) (unused) ciao-controller/controller_test.go:1104:6:warning: func startTestWorkload is unused (U1000) (unused) ciao-controller/controller_test.go:1123:6:warning: func testStartWorkloadLaunchCNCI is unused (U1000) (unused) ciao-controller/openstack_compute.go:552:5:warning: field Links is unused (U1000) (unused) qemu/qmp_test.go:493:3:warning: const seconds is unused (U1000) (unused) qemu/qmp_test.go:494:3:warning: const microsecondsEv1 is unused (U1000) (unused) qemu/qmp_test.go:495:3:warning: const device is unused (U1000) (unused) qemu/qmp_test.go:496:3:warning: const path is unused (U1000) (unused) templateutils/example_test.go:53:3:warning: field hidden is unused (U1000) (unused) Signed-off-by: Rob Bradford --- ciao-cli/main.go | 2 -- ciao-controller/api.go | 16 +--------------- ciao-controller/api/api_test.go | 6 ------ ciao-image/datastore/datastore_test.go | 1 - networking/ciao-cnci-agent/network.go | 2 -- .../libsnnet/tests/parallel/parallel_test.go | 16 ---------------- openstack/compute/api.go | 7 ------- openstack/compute/api_test.go | 6 ------ qemu/qmp_test.go | 7 ------- 9 files changed, 1 insertion(+), 62 deletions(-) diff --git a/ciao-cli/main.go b/ciao-cli/main.go index ee1467221..348106f54 100644 --- a/ciao-cli/main.go +++ b/ciao-cli/main.go @@ -102,8 +102,6 @@ var scopedToken string const openstackComputePort = 8774 const openstackComputeVersion = "v2.1" -type action uint8 - func infof(format string, args ...interface{}) { if glog.V(1) { glog.InfoDepth(1, fmt.Sprintf("ciao-cli INFO: "+format, args...)) diff --git a/ciao-controller/api.go b/ciao-controller/api.go index 819b37e10..1eea9ae87 100644 --- a/ciao-controller/api.go +++ b/ciao-controller/api.go @@ -68,15 +68,9 @@ func errorResponse(err error) APIResponse { type pagerFilterType uint8 const ( - none pagerFilterType = 0 - statusFilter = 0x2 + none pagerFilterType = 0 ) -type pager interface { - filter(filterType pagerFilterType, filter string, item interface{}) bool - nextPage(filterType pagerFilterType, filter string, r *http.Request) ([]byte, error) -} - func pagerQueryParse(r *http.Request) (int, int, string) { values := r.URL.Query() limit := 0 @@ -133,10 +127,6 @@ func (pager *nodePager) getNodes(filterType pagerFilterType, filter string, node return computeNodes, nil } -func (pager *nodePager) filter(filterType pagerFilterType, filter string, node types.CiaoNode) bool { - return false -} - func (pager *nodePager) nextPage(filterType pagerFilterType, filter string, r *http.Request) (types.CiaoNodes, error) { limit, offset, lastSeen := pagerQueryParse(r) @@ -195,10 +185,6 @@ func (pager *nodeServerPager) getNodeServers(filterType pagerFilterType, filter return servers, nil } -func (pager *nodeServerPager) filter(filterType pagerFilterType, filter string, instance types.CiaoServerStats) bool { - return false -} - func (pager *nodeServerPager) nextPage(filterType pagerFilterType, filter string, r *http.Request) (types.CiaoServersStats, error) { limit, offset, lastSeen := pagerQueryParse(r) diff --git a/ciao-controller/api/api_test.go b/ciao-controller/api/api_test.go index 94461f505..ed7f01339 100644 --- a/ciao-controller/api/api_test.go +++ b/ciao-controller/api/api_test.go @@ -19,7 +19,6 @@ import ( "fmt" "net/http" "net/http/httptest" - "os" "testing" "github.com/01org/ciao/ciao-controller/types" @@ -36,11 +35,6 @@ type test struct { expectedResponse string } -func myHostname() string { - host, _ := os.Hostname() - return host -} - var tests = []test{ { "GET", diff --git a/ciao-image/datastore/datastore_test.go b/ciao-image/datastore/datastore_test.go index 9acaaa273..a8bc88e47 100644 --- a/ciao-image/datastore/datastore_test.go +++ b/ciao-image/datastore/datastore_test.go @@ -25,7 +25,6 @@ import ( ) var mountPoint = "/tmp" -var metaDsTables = []string{"images"} var dbDir = "/tmp" var dbFile = "ciao-image.db" var testImageID = "12345678-1234-5678-1234-567812345678" diff --git a/networking/ciao-cnci-agent/network.go b/networking/ciao-cnci-agent/network.go index ae2be11bf..70ed26b93 100644 --- a/networking/ciao-cnci-agent/network.go +++ b/networking/ciao-cnci-agent/network.go @@ -95,8 +95,6 @@ func initNetwork(cancelCh <-chan os.Signal) error { } func unmarshallSubnetParams(cmd *payloads.TenantAddedEvent) (*net.IPNet, int, net.IP, error) { - const maxKey = ^uint32(0) - _, snet, err := net.ParseCIDR(cmd.TenantSubnet) if err != nil { return nil, 0, nil, errors.Wrapf(err, "invalid Remote subnet") diff --git a/networking/libsnnet/tests/parallel/parallel_test.go b/networking/libsnnet/tests/parallel/parallel_test.go index d384d7e6b..d2c0a56f6 100644 --- a/networking/libsnnet/tests/parallel/parallel_test.go +++ b/networking/libsnnet/tests/parallel/parallel_test.go @@ -368,22 +368,6 @@ func dockerNetDelete(t *testing.T, subnetID string) error { return err } -func dockerNetList(t *testing.T) error { - assert := assert.New(t) - defer logTime(t, time.Now(), "dockerNetList") - out, err := exec.Command("docker", "network", "ls").CombinedOutput() - assert.Nil(err, string(out)) - return err -} - -func dockerNetInfo(t *testing.T, subnetID string) error { - assert := assert.New(t) - defer logTime(t, time.Now(), "dockerNetInfo") - out, err := exec.Command("docker", "network", "inspect", subnetID).CombinedOutput() - assert.Nil(err, string(out)) - return err -} - type dockerNetType int const ( diff --git a/openstack/compute/api.go b/openstack/compute/api.go index 6a010f695..e321cb46b 100644 --- a/openstack/compute/api.go +++ b/openstack/compute/api.go @@ -305,15 +305,8 @@ type pagerFilterType uint8 const ( none pagerFilterType = iota flavorFilter - limit - marker ) -type pager interface { - filter(filterType pagerFilterType, filter string, item interface{}) bool - nextPage(filterType pagerFilterType, filter string, r *http.Request) ([]byte, error) -} - type serverPager struct { servers []ServerDetails } diff --git a/openstack/compute/api_test.go b/openstack/compute/api_test.go index 36ae5ba23..1c06c30e6 100644 --- a/openstack/compute/api_test.go +++ b/openstack/compute/api_test.go @@ -18,7 +18,6 @@ import ( "bytes" "net/http" "net/http/httptest" - "os" "testing" ) @@ -31,11 +30,6 @@ type test struct { expectedResponse string } -func myHostname() string { - host, _ := os.Hostname() - return host -} - var tests = []test{ { "POST", diff --git a/qemu/qmp_test.go b/qemu/qmp_test.go index 51058ec26..ce94c8ed5 100644 --- a/qemu/qmp_test.go +++ b/qemu/qmp_test.go @@ -489,13 +489,6 @@ func TestQMPDeviceDel(t *testing.T) { // The device_del command should timeout after 1 second and the QMP loop // should exit gracefully. func TestQMPDeviceDelTimeout(t *testing.T) { - const ( - seconds = 1352167040730 - microsecondsEv1 = 123456 - device = "device_" + testutil.VolumeUUID - path = "/dev/rbd0" - ) - var wg sync.WaitGroup connectedCh := make(chan *QMPVersion) disconnectedCh := make(chan struct{})