Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit c1c6bf8

Browse files
author
Jamie Hannaford
committed
Remove duplication
1 parent 8252352 commit c1c6bf8

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

rackspace/db/v1/backups/requests_test.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ func TestCreate(t *testing.T) {
3636
Size: 100,
3737
Status: "NEW",
3838
Updated: "2014-02-13T21:47:16",
39-
Datastore: Datastore{Version: "5.1", Type: "MySQL", VersionID: "20000000-0000-0000-0000-000000000002"},
39+
Datastore: datastores.Datastore{
40+
Version: "5.1",
41+
Type: "MySQL",
42+
VersionID: "20000000-0000-0000-0000-000000000002",
43+
},
4044
}
4145

4246
th.AssertDeepEquals(t, expected, instance)
@@ -67,7 +71,11 @@ func TestList(t *testing.T) {
6771
Size: 0.141026,
6872
Status: "COMPLETED",
6973
Updated: "2014-06-18T21:24:39",
70-
Datastore: Datastore{Version: "5.1", Type: "MySQL", VersionID: "20000000-0000-0000-0000-000000000002"},
74+
Datastore: datastores.Datastore{
75+
Version: "5.1",
76+
Type: "MySQL",
77+
VersionID: "20000000-0000-0000-0000-000000000002",
78+
},
7179
},
7280
}
7381

@@ -101,7 +109,11 @@ func TestGet(t *testing.T) {
101109
Size: 100,
102110
Status: "NEW",
103111
Updated: "2014-02-13T21:47:16",
104-
Datastore: Datastore{Version: "5.1", Type: "MySQL", VersionID: "20000000-0000-0000-0000-000000000002"},
112+
Datastore: datastores.Datastore{
113+
Version: "5.1",
114+
Type: "MySQL",
115+
VersionID: "20000000-0000-0000-0000-000000000002",
116+
},
105117
}
106118

107119
th.AssertDeepEquals(t, expected, instance)

rackspace/db/v1/backups/results.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ import (
44
"github.com/mitchellh/mapstructure"
55
"github.com/rackspace/gophercloud"
66
"github.com/rackspace/gophercloud/pagination"
7+
"github.com/rackspace/gophercloud/rackspace/db/v1/datastores"
78
)
89

9-
type Datastore struct {
10-
Version string
11-
Type string
12-
VersionID string `json:"version_id" mapstructure:"version_id"`
13-
}
14-
1510
type Backup struct {
1611
Description string
1712
ID string
@@ -23,7 +18,7 @@ type Backup struct {
2318
Status string
2419
Created string
2520
Updated string
26-
Datastore Datastore
21+
Datastore datastores.Datastore
2722
}
2823

2924
type CreateResult struct {

rackspace/db/v1/instances/results.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ import (
55
"github.com/rackspace/gophercloud"
66
os "github.com/rackspace/gophercloud/openstack/db/v1/instances"
77
"github.com/rackspace/gophercloud/pagination"
8+
"github.com/rackspace/gophercloud/rackspace/db/v1/datastores"
89
)
910

10-
type Datastore struct {
11-
Type string
12-
Version string
13-
}
14-
1511
// Instance represents a remote MySQL instance.
1612
type Instance struct {
1713
// Indicates the datetime that the instance was created
@@ -21,7 +17,7 @@ type Instance struct {
2117
Updated string //time.Time
2218

2319
// Indicates how the instance stores data.
24-
Datastore Datastore
20+
Datastore datastores.Datastore
2521

2622
// Indicates the hardware flavor the instance uses.
2723
Flavor os.Flavor

0 commit comments

Comments
 (0)