Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 39e8a0a

Browse filesBrowse files
authored
Compute v2: Add locked status
1 parent 9158f73 commit 39e8a0a
Copy full SHA for 39e8a0a

File tree

Expand file treeCollapse file tree

3 files changed

+11
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+11
-2
lines changed

‎openstack/compute/v2/servers/results.go

Copy file name to clipboardExpand all lines: openstack/compute/v2/servers/results.go
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ type Server struct {
279279

280280
// AvailabilityZone is the availabilty zone the server is in.
281281
AvailabilityZone string `json:"OS-EXT-AZ:availability_zone"`
282+
283+
// Locked indicates the lock status of the server
284+
// This requires microversion 2.9 or later
285+
Locked *bool `json:"locked"`
282286
}
283287

284288
type AttachedVolume struct {

‎openstack/compute/v2/servers/testing/fixtures_test.go

Copy file name to clipboardExpand all lines: openstack/compute/v2/servers/testing/fixtures_test.go
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ const ServerListBody = `
158158
"progress": 0,
159159
"OS-EXT-STS:power_state": 1,
160160
"config_drive": "",
161-
"metadata": {}
161+
"metadata": {},
162+
"locked": true
162163
},
163164
{
164165
"status": "ACTIVE",
@@ -297,7 +298,8 @@ const SingleServerBody = `
297298
"progress": 0,
298299
"OS-EXT-STS:power_state": 1,
299300
"config_drive": "",
300-
"metadata": {}
301+
"metadata": {},
302+
"locked": true
301303
}
302304
}
303305
`
@@ -631,6 +633,7 @@ var (
631633
TerminatedAt: time.Time{},
632634
DiskConfig: servers.Manual,
633635
AvailabilityZone: "nova",
636+
Locked: func() *bool { b := true; return &b }(),
634637
}
635638

636639
ConsoleOutput = "abc"

‎openstack/compute/v2/servers/testing/requests_test.go

Copy file name to clipboardExpand all lines: openstack/compute/v2/servers/testing/requests_test.go
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ func TestGetFaultyServer(t *testing.T) {
774774

775775
FaultyServer := ServerDerp
776776
FaultyServer.Fault = DerpFault
777+
FaultyServer.Locked = nil
777778
th.CheckDeepEquals(t, FaultyServer, *actual)
778779
}
779780

@@ -1145,6 +1146,7 @@ func TestCreateServerWithTags(t *testing.T) {
11451146
tags := []string{"foo", "bar"}
11461147
ServerDerpTags := ServerDerp
11471148
ServerDerpTags.Tags = &tags
1149+
ServerDerpTags.Locked = nil
11481150

11491151
createOpts := servers.CreateOpts{
11501152
Name: "derp",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.