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
a9f07bc3
Commit
a9f07bc3
authored
Apr 21, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #912 from nebula/populate_api
builder/openstack: added support for gophercloud's PopulateApi
parents
7e16d12b
ee95fbbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
builder/openstack/builder.go
builder/openstack/builder.go
+8
-6
builder/openstack/run_config.go
builder/openstack/run_config.go
+6
-5
No files found.
builder/openstack/builder.go
View file @
a9f07bc3
...
...
@@ -60,13 +60,15 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
if
err
!=
nil
{
return
nil
,
err
}
api
:=
&
gophercloud
.
ApiCriteria
{
Name
:
"cloudServersOpenStack"
,
Region
:
b
.
config
.
AccessConfig
.
Region
(),
VersionId
:
"2"
,
UrlChoice
:
gophercloud
.
PublicURL
,
//fetches the api requisites from gophercloud for the appropriate
//openstack variant
api
,
err
:=
gophercloud
.
PopulateApi
(
b
.
config
.
RunConfig
.
OpenstackProvider
)
if
err
!=
nil
{
return
nil
,
err
}
csp
,
err
:=
gophercloud
.
ServersApi
(
auth
,
*
api
)
api
.
Region
=
b
.
config
.
AccessConfig
.
Region
()
csp
,
err
:=
gophercloud
.
ServersApi
(
auth
,
api
)
if
err
!=
nil
{
log
.
Printf
(
"Region: %s"
,
b
.
config
.
AccessConfig
.
Region
())
return
nil
,
err
...
...
builder/openstack/run_config.go
View file @
a9f07bc3
...
...
@@ -10,11 +10,12 @@ import (
// RunConfig contains configuration for running an instance from a source
// image and details on how to access that launched image.
type
RunConfig
struct
{
SourceImage
string
`mapstructure:"source_image"`
Flavor
string
`mapstructure:"flavor"`
RawSSHTimeout
string
`mapstructure:"ssh_timeout"`
SSHUsername
string
`mapstructure:"ssh_username"`
SSHPort
int
`mapstructure:"ssh_port"`
SourceImage
string
`mapstructure:"source_image"`
Flavor
string
`mapstructure:"flavor"`
RawSSHTimeout
string
`mapstructure:"ssh_timeout"`
SSHUsername
string
`mapstructure:"ssh_username"`
SSHPort
int
`mapstructure:"ssh_port"`
OpenstackProvider
string
`mapstructure:"openstack_provider"`
// Unexported fields that are calculated from others
sshTimeout
time
.
Duration
...
...
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