Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
be606418
Commit
be606418
authored
Jun 30, 2014
by
Ross Smith II
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1304 from lflux/fix-openstack-serverid-crash
Fix openstack ServerById crash
parents
753a990c
3af14d3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
builder/openstack/server.go
builder/openstack/server.go
+13
-3
No files found.
builder/openstack/server.go
View file @
be606418
...
...
@@ -30,15 +30,25 @@ type StateChangeConf struct {
}
// ServerStateRefreshFunc returns a StateRefreshFunc that is used to watch
// an openstac
n
server.
// an openstac
k
server.
func
ServerStateRefreshFunc
(
csp
gophercloud
.
CloudServersProvider
,
s
*
gophercloud
.
Server
)
StateRefreshFunc
{
return
func
()
(
interface
{},
string
,
int
,
error
)
{
resp
,
err
:=
csp
.
ServerById
(
s
.
Id
)
servers
,
err
:=
csp
.
ListServers
(
)
if
err
!=
nil
{
log
.
Printf
(
"Error on ServerStateRefresh: %s"
,
err
)
return
nil
,
""
,
0
,
err
}
var
resp
*
gophercloud
.
Server
found
:=
false
for
_
,
server
:=
range
servers
{
if
server
.
Id
==
s
.
Id
{
found
=
true
resp
=
&
server
}
}
if
found
==
false
{
return
nil
,
"DELETED"
,
0
,
nil
}
return
resp
,
resp
.
Status
,
resp
.
Progress
,
nil
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment