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
9bd33d1e
Commit
9bd33d1e
authored
Aug 15, 2014
by
Marc Abramowitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make region required for rackspace but not other providers
Update test to make it pass.
parent
69500b69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
builder/openstack/access_config.go
builder/openstack/access_config.go
+6
-0
builder/openstack/access_config_test.go
builder/openstack/access_config_test.go
+10
-1
No files found.
builder/openstack/access_config.go
View file @
9bd33d1e
...
...
@@ -115,6 +115,12 @@ func (c *AccessConfig) Prepare(t *packer.ConfigTemplate) []error {
}
}
if
strings
.
HasPrefix
(
c
.
Provider
,
"rackspace"
)
{
if
c
.
Region
()
==
""
{
errs
=
append
(
errs
,
fmt
.
Errorf
(
"region must be specified when using rackspace"
))
}
}
if
len
(
errs
)
>
0
{
return
errs
}
...
...
builder/openstack/access_config_test.go
View file @
9bd33d1e
...
...
@@ -8,13 +8,22 @@ func testAccessConfig() *AccessConfig {
return
&
AccessConfig
{}
}
func
TestAccessConfigPrepare_NoRegion
(
t
*
testing
.
T
)
{
func
TestAccessConfigPrepare_NoRegion
_Rackspace
(
t
*
testing
.
T
)
{
c
:=
testAccessConfig
()
c
.
Provider
=
"rackspace-us"
if
err
:=
c
.
Prepare
(
nil
);
err
==
nil
{
t
.
Fatalf
(
"shouldn't have err: %s"
,
err
)
}
}
func
TestAccessConfigPrepare_NoRegion_PrivateCloud
(
t
*
testing
.
T
)
{
c
:=
testAccessConfig
()
c
.
Provider
=
"http://some-keystone-server:5000/v2.0"
if
err
:=
c
.
Prepare
(
nil
);
err
!=
nil
{
t
.
Fatalf
(
"shouldn't have err: %s"
,
err
)
}
}
func
TestAccessConfigPrepare_Region
(
t
*
testing
.
T
)
{
dfw
:=
"DFW"
c
:=
testAccessConfig
()
...
...
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