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

Commit 94e4cc5

Browse files
committed
Renaming functions to be more appropriate to their task
1 parent d97fe9b commit 94e4cc5

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

acceptance/openstack/compute/v2/floatingip_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ func associateFloatingIP(t *testing.T, client *gophercloud.ServiceClient, server
7171
FloatingIP: fip.IP,
7272
}
7373

74-
err := floatingip.AssociateFloatingIP(client, associateOpts).ExtractErr()
74+
err := floatingip.AssociateInstance(client, associateOpts).ExtractErr()
7575
th.AssertNoErr(t, err)
7676
t.Logf("Associated floating IP %v from instance %v", fip.IP, serverId)
7777
defer func() {
78-
err = floatingip.DisassociateFloatingIP(client, associateOpts).ExtractErr()
78+
err = floatingip.DisassociateInstance(client, associateOpts).ExtractErr()
7979
th.AssertNoErr(t, err)
8080
t.Logf("Disassociated floating IP %v from instance %v", fip.IP, serverId)
8181
}()
@@ -108,11 +108,11 @@ func associateFloatingIPFixed(t *testing.T, client *gophercloud.ServiceClient, s
108108
FixedIP: fixedIP,
109109
}
110110

111-
err = floatingip.AssociateFloatingIP(client, associateOpts).ExtractErr()
111+
err = floatingip.AssociateInstance(client, associateOpts).ExtractErr()
112112
th.AssertNoErr(t, err)
113113
t.Logf("Associated floating IP %v from instance %v with Fixed IP %v", fip.IP, serverId, fixedIP)
114114
defer func() {
115-
err = floatingip.DisassociateFloatingIP(client, associateOpts).ExtractErr()
115+
err = floatingip.DisassociateInstance(client, associateOpts).ExtractErr()
116116
th.AssertNoErr(t, err)
117117
t.Logf("Disassociated floating IP %v from instance %v with Fixed IP %v", fip.IP, serverId, fixedIP)
118118
}()

openstack/compute/v2/extensions/floatingip/requests.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
100100
// association / disassociation
101101

102102
// Associate pairs an allocated floating IP with an instance
103-
// Deprecated. Use AssociateFloatingIP.
103+
// Deprecated. Use AssociateInstance.
104104
func Associate(client *gophercloud.ServiceClient, serverId, fip string) AssociateResult {
105105
var res AssociateResult
106106

@@ -112,8 +112,8 @@ func Associate(client *gophercloud.ServiceClient, serverId, fip string) Associat
112112
return res
113113
}
114114

115-
// AssociateFloatingIP pairs an allocated floating IP with an instance.
116-
func AssociateFloatingIP(client *gophercloud.ServiceClient, opts AssociateOpts) AssociateResult {
115+
// AssociateInstance pairs an allocated floating IP with an instance.
116+
func AssociateInstance(client *gophercloud.ServiceClient, opts AssociateOpts) AssociateResult {
117117
var res AssociateResult
118118

119119
associateInfo, err := opts.ToAssociateMap()
@@ -138,7 +138,7 @@ func AssociateFloatingIP(client *gophercloud.ServiceClient, opts AssociateOpts)
138138
}
139139

140140
// Disassociate decouples an allocated floating IP from an instance
141-
// Deprecated. Use DisassociateFloatingIP.
141+
// Deprecated. Use DisassociateInstance.
142142
func Disassociate(client *gophercloud.ServiceClient, serverId, fip string) DisassociateResult {
143143
var res DisassociateResult
144144

@@ -150,8 +150,8 @@ func Disassociate(client *gophercloud.ServiceClient, serverId, fip string) Disas
150150
return res
151151
}
152152

153-
// DisassociateFloatingIP decouples an allocated floating IP from an instance
154-
func DisassociateFloatingIP(client *gophercloud.ServiceClient, opts AssociateOpts) DisassociateResult {
153+
// DisassociateInstance decouples an allocated floating IP from an instance
154+
func DisassociateInstance(client *gophercloud.ServiceClient, opts AssociateOpts) DisassociateResult {
155155
var res DisassociateResult
156156

157157
associateInfo, err := opts.ToAssociateMap()

openstack/compute/v2/extensions/floatingip/requests_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func TestAssociate(t *testing.T) {
7878
FloatingIP: "10.10.10.2",
7979
}
8080

81-
err := AssociateFloatingIP(client.ServiceClient(), associateOpts).ExtractErr()
81+
err := AssociateInstance(client.ServiceClient(), associateOpts).ExtractErr()
8282
th.AssertNoErr(t, err)
8383
}
8484

@@ -93,7 +93,7 @@ func TestAssociateFixed(t *testing.T) {
9393
FixedIP: "166.78.185.201",
9494
}
9595

96-
err := AssociateFloatingIP(client.ServiceClient(), associateOpts).ExtractErr()
96+
err := AssociateInstance(client.ServiceClient(), associateOpts).ExtractErr()
9797
th.AssertNoErr(t, err)
9898
}
9999

@@ -108,7 +108,7 @@ func TestDisassociateDeprecated(t *testing.T) {
108108
th.AssertNoErr(t, err)
109109
}
110110

111-
func TestDisassociateFloatingIP(t *testing.T) {
111+
func TestDisassociateInstance(t *testing.T) {
112112
th.SetupHTTP()
113113
defer th.TeardownHTTP()
114114
HandleDisassociateSuccessfully(t)
@@ -118,6 +118,6 @@ func TestDisassociateFloatingIP(t *testing.T) {
118118
FloatingIP: "10.10.10.2",
119119
}
120120

121-
err := DisassociateFloatingIP(client.ServiceClient(), associateOpts).ExtractErr()
121+
err := DisassociateInstance(client.ServiceClient(), associateOpts).ExtractErr()
122122
th.AssertNoErr(t, err)
123123
}

0 commit comments

Comments
 (0)