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
23446d56
Commit
23446d56
authored
Apr 21, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/openstack: use proper function call for config
parent
8395d0e9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
CHANGELOG.md
CHANGELOG.md
+2
-0
builder/openstack/access_config.go
builder/openstack/access_config.go
+7
-7
No files found.
CHANGELOG.md
View file @
23446d56
...
...
@@ -13,6 +13,8 @@ IMPROVEMENTS:
*
builder/amazon: Added
`ssh_private_key_file`
option [GH-971]
*
builder/amazon: Added
`ami_virtualization_type`
option [GH-1021]
*
builder/openstack: Support for conventional OpenStack environmental
variables such as
`OS_USERNAME`
,
`OS_PASSWORD`
, etc. [GH-768]
*
builder/openstack: Support
`openstack_provider`
option to automatically
fill defaults for different OpenStack variants. [GH-912]
*
builder/qemu: User variable expansion in
`ssh_key_path`
[GH-918]
...
...
builder/openstack/access_config.go
View file @
23446d56
...
...
@@ -25,12 +25,12 @@ type AccessConfig struct {
// Auth returns a valid Auth object for access to openstack services, or
// an error if the authentication couldn't be resolved.
func
(
c
*
AccessConfig
)
Auth
()
(
gophercloud
.
AccessProvider
,
error
)
{
c
.
Username
=
common
.
C
oalesceVals
(
c
.
Username
,
os
.
Getenv
(
"SDK_USERNAME"
),
os
.
Getenv
(
"OS_USERNAME"
))
c
.
Password
=
common
.
C
oalesceVals
(
c
.
Password
,
os
.
Getenv
(
"SDK_PASSWORD"
),
os
.
Getenv
(
"OS_PASSWORD"
))
c
.
ApiKey
=
common
.
C
oalesceVals
(
c
.
ApiKey
,
os
.
Getenv
(
"SDK_API_KEY"
))
c
.
Project
=
common
.
C
oalesceVals
(
c
.
Project
,
os
.
Getenv
(
"SDK_PROJECT"
),
os
.
Getenv
(
"OS_TENANT_NAME"
))
c
.
Provider
=
common
.
C
oalesceVals
(
c
.
Provider
,
os
.
Getenv
(
"SDK_PROVIDER"
),
os
.
Getenv
(
"OS_AUTH_URL"
))
c
.
RawRegion
=
common
.
C
oalesceVals
(
c
.
RawRegion
,
os
.
Getenv
(
"SDK_REGION"
),
os
.
Getenv
(
"OS_REGION_NAME"
))
c
.
Username
=
common
.
C
hooseString
(
c
.
Username
,
os
.
Getenv
(
"SDK_USERNAME"
),
os
.
Getenv
(
"OS_USERNAME"
))
c
.
Password
=
common
.
C
hooseString
(
c
.
Password
,
os
.
Getenv
(
"SDK_PASSWORD"
),
os
.
Getenv
(
"OS_PASSWORD"
))
c
.
ApiKey
=
common
.
C
hooseString
(
c
.
ApiKey
,
os
.
Getenv
(
"SDK_API_KEY"
))
c
.
Project
=
common
.
C
hooseString
(
c
.
Project
,
os
.
Getenv
(
"SDK_PROJECT"
),
os
.
Getenv
(
"OS_TENANT_NAME"
))
c
.
Provider
=
common
.
C
hooseString
(
c
.
Provider
,
os
.
Getenv
(
"SDK_PROVIDER"
),
os
.
Getenv
(
"OS_AUTH_URL"
))
c
.
RawRegion
=
common
.
C
hooseString
(
c
.
RawRegion
,
os
.
Getenv
(
"SDK_REGION"
),
os
.
Getenv
(
"OS_REGION_NAME"
))
// OpenStack's auto-generated openrc.sh files do not append the suffix
// /tokens to the authentication URL. This ensures it is present when
...
...
@@ -67,7 +67,7 @@ func (c *AccessConfig) Auth() (gophercloud.AccessProvider, error) {
}
func
(
c
*
AccessConfig
)
Region
()
string
{
return
common
.
C
oalesceVals
(
c
.
RawRegion
,
os
.
Getenv
(
"SDK_REGION"
),
os
.
Getenv
(
"OS_REGION_NAME"
))
return
common
.
C
hooseString
(
c
.
RawRegion
,
os
.
Getenv
(
"SDK_REGION"
),
os
.
Getenv
(
"OS_REGION_NAME"
))
}
func
(
c
*
AccessConfig
)
Prepare
(
t
*
packer
.
ConfigTemplate
)
[]
error
{
...
...
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