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
6cf8d9b3
Commit
6cf8d9b3
authored
Dec 24, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware/common: StepSuppressMessages
parent
e5f674a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
7 deletions
+43
-7
builder/vmware/common/step_suppress_messages.go
builder/vmware/common/step_suppress_messages.go
+5
-6
builder/vmware/common/step_suppress_messages_test.go
builder/vmware/common/step_suppress_messages_test.go
+36
-0
builder/vmware/common/step_test.go
builder/vmware/common/step_test.go
+1
-0
builder/vmware/iso/builder.go
builder/vmware/iso/builder.go
+1
-1
No files found.
builder/vmware/
iso
/step_suppress_messages.go
→
builder/vmware/
common
/step_suppress_messages.go
View file @
6cf8d9b3
package
iso
package
common
import
(
"fmt"
"github.com/mitchellh/multistep"
vmwcommon
"github.com/mitchellh/packer/builder/vmware/common"
"github.com/mitchellh/packer/packer"
"log"
)
// This step suppresses any messages that VMware product might show.
type
s
tepSuppressMessages
struct
{}
type
S
tepSuppressMessages
struct
{}
func
(
s
*
s
tepSuppressMessages
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
driver
:=
state
.
Get
(
"driver"
)
.
(
vmwcommon
.
Driver
)
func
(
s
*
S
tepSuppressMessages
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmxPath
:=
state
.
Get
(
"vmx_path"
)
.
(
string
)
...
...
@@ -27,4 +26,4 @@ func (s *stepSuppressMessages) Run(state multistep.StateBag) multistep.StepActio
return
multistep
.
ActionContinue
}
func
(
s
*
s
tepSuppressMessages
)
Cleanup
(
state
multistep
.
StateBag
)
{}
func
(
s
*
S
tepSuppressMessages
)
Cleanup
(
state
multistep
.
StateBag
)
{}
builder/vmware/common/step_suppress_messages_test.go
0 → 100644
View file @
6cf8d9b3
package
common
import
(
"testing"
"github.com/mitchellh/multistep"
)
func
TestStepSuppressMessages_impl
(
t
*
testing
.
T
)
{
var
_
multistep
.
Step
=
new
(
StepSuppressMessages
)
}
func
TestStepSuppressMessages
(
t
*
testing
.
T
)
{
state
:=
testState
(
t
)
step
:=
new
(
StepSuppressMessages
)
state
.
Put
(
"vmx_path"
,
"foo"
)
driver
:=
state
.
Get
(
"driver"
)
.
(
*
DriverMock
)
// Test the run
if
action
:=
step
.
Run
(
state
);
action
!=
multistep
.
ActionContinue
{
t
.
Fatalf
(
"bad action: %#v"
,
action
)
}
if
_
,
ok
:=
state
.
GetOk
(
"error"
);
ok
{
t
.
Fatal
(
"should NOT have error"
)
}
// Test the driver
if
!
driver
.
SuppressMessagesCalled
{
t
.
Fatal
(
"should've called"
)
}
if
driver
.
SuppressMessagesPath
!=
"foo"
{
t
.
Fatal
(
"should call with right path"
)
}
}
builder/vmware/common/step_test.go
View file @
6cf8d9b3
...
...
@@ -9,6 +9,7 @@ import (
func
testState
(
t
*
testing
.
T
)
multistep
.
StateBag
{
state
:=
new
(
multistep
.
BasicStateBag
)
state
.
Put
(
"driver"
,
new
(
DriverMock
))
state
.
Put
(
"ui"
,
&
packer
.
BasicUi
{
Reader
:
new
(
bytes
.
Buffer
),
Writer
:
new
(
bytes
.
Buffer
),
...
...
builder/vmware/iso/builder.go
View file @
6cf8d9b3
...
...
@@ -392,7 +392,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&
vmwcommon
.
StepConfigureVMX
{
CustomData
:
b
.
config
.
VMXData
,
},
&
s
tepSuppressMessages
{},
&
vmwcommon
.
S
tepSuppressMessages
{},
&
stepHTTPServer
{},
&
stepConfigureVNC
{},
&
stepRun
{},
...
...
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