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
60081c32
Commit
60081c32
authored
Jun 13, 2015
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
helper/communicator: ssh settings aren't required if type is none
parent
4b4fe228
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
helper/communicator/config.go
helper/communicator/config.go
+4
-2
helper/communicator/config_test.go
helper/communicator/config_test.go
+7
-0
No files found.
helper/communicator/config.go
View file @
60081c32
...
...
@@ -35,8 +35,10 @@ func (c *Config) Prepare(ctx *interpolate.Context) []error {
// Validation
var
errs
[]
error
if
c
.
SSHUsername
==
""
{
errs
=
append
(
errs
,
errors
.
New
(
"An ssh_username must be specified"
))
if
c
.
Type
==
"ssh"
{
if
c
.
SSHUsername
==
""
{
errs
=
append
(
errs
,
errors
.
New
(
"An ssh_username must be specified"
))
}
}
return
errs
...
...
helper/communicator/config_test.go
View file @
60081c32
...
...
@@ -23,6 +23,13 @@ func TestConfigType(t *testing.T) {
}
}
func
TestConfig_none
(
t
*
testing
.
T
)
{
c
:=
&
Config
{
Type
:
"none"
}
if
err
:=
c
.
Prepare
(
testContext
(
t
));
len
(
err
)
>
0
{
t
.
Fatalf
(
"bad: %#v"
,
err
)
}
}
func
testContext
(
t
*
testing
.
T
)
*
interpolate
.
Context
{
return
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