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
e4f1dcb6
Commit
e4f1dcb6
authored
Nov 08, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware: Fusion suppresses upgrade requests
parent
781332b2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
0 deletions
+66
-0
CHANGELOG.md
CHANGELOG.md
+1
-0
builder/vmware/builder.go
builder/vmware/builder.go
+1
-0
builder/vmware/driver.go
builder/vmware/driver.go
+4
-0
builder/vmware/driver_esx5.go
builder/vmware/driver_esx5.go
+4
-0
builder/vmware/driver_fusion5.go
builder/vmware/driver_fusion5.go
+19
-0
builder/vmware/driver_player5.go
builder/vmware/driver_player5.go
+4
-0
builder/vmware/driver_workstation9.go
builder/vmware/driver_workstation9.go
+4
-0
builder/vmware/step_suppress_messages.go
builder/vmware/step_suppress_messages.go
+29
-0
No files found.
CHANGELOG.md
View file @
e4f1dcb6
...
...
@@ -19,6 +19,7 @@ BUG FIXES:
*
builder/amazon/chroot: Copying empty directories works. [GH-588]
*
builder/amazon/chroot: Chroot commands work with shell provisioners. [GH-581]
*
builder/vmware: VMX modifications are now case-insensitive. [GH-608]
*
builder/vmware: VMware Fusion won't ask for VM upgrade.
## 0.3.11 (November 4, 2013)
...
...
builder/vmware/builder.go
View file @
e4f1dcb6
...
...
@@ -405,6 +405,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
},
&
stepCreateDisk
{},
&
stepCreateVMX
{},
&
stepSuppressMessages
{},
&
stepHTTPServer
{},
&
stepConfigureVNC
{},
&
stepRun
{},
...
...
builder/vmware/driver.go
View file @
e4f1dcb6
...
...
@@ -31,6 +31,10 @@ type Driver interface {
// Stop stops a VM specified by the path to the VMX given.
Stop
(
string
)
error
// SuppressMessages modifies the VMX or surrounding directory so that
// VMware doesn't show any annoying messages.
SuppressMessages
(
string
)
error
// Get the path to the VMware ISO for the given flavor.
ToolsIsoPath
(
string
)
string
...
...
builder/vmware/driver_esx5.go
View file @
e4f1dcb6
...
...
@@ -68,6 +68,10 @@ func (d *ESX5Driver) Register(vmxPathLocal string) error {
return
d
.
sh
(
"vim-cmd"
,
"solo/registervm"
,
vmxPath
)
}
func
(
d
*
ESX5Driver
)
SuppressMessages
(
vmxPath
string
)
error
{
return
nil
}
func
(
d
*
ESX5Driver
)
Unregister
(
vmxPathLocal
string
)
error
{
vmxPath
:=
filepath
.
Join
(
d
.
outputDir
,
filepath
.
Base
(
vmxPathLocal
))
return
d
.
sh
(
"vim-cmd"
,
"vmsvc/unregister"
,
vmxPath
)
...
...
builder/vmware/driver_fusion5.go
View file @
e4f1dcb6
...
...
@@ -3,6 +3,7 @@ package vmware
import
(
"fmt"
"github.com/mitchellh/multistep"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
...
...
@@ -86,6 +87,15 @@ func (d *Fusion5Driver) Stop(vmxPath string) error {
return
nil
}
func
(
d
*
Fusion5Driver
)
SuppressMessages
(
vmxPath
string
)
error
{
dir
:=
filepath
.
Dir
(
vmxPath
)
base
:=
filepath
.
Base
(
vmxPath
)
base
=
strings
.
Replace
(
base
,
".vmx"
,
""
,
-
1
)
plistPath
:=
filepath
.
Join
(
dir
,
base
+
".plist"
)
return
ioutil
.
WriteFile
(
plistPath
,
[]
byte
(
fusionSuppressPlist
),
0644
)
}
func
(
d
*
Fusion5Driver
)
Verify
()
error
{
if
_
,
err
:=
os
.
Stat
(
d
.
AppPath
);
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
...
...
@@ -129,3 +139,12 @@ func (d *Fusion5Driver) ToolsIsoPath(k string) string {
func
(
d
*
Fusion5Driver
)
DhcpLeasesPath
(
device
string
)
string
{
return
"/var/db/vmware/vmnet-dhcpd-"
+
device
+
".leases"
}
const
fusionSuppressPlist
=
`<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>disallowUpgrade</key>
<true/>
</dict>
</plist>`
builder/vmware/driver_player5.go
View file @
e4f1dcb6
...
...
@@ -114,6 +114,10 @@ func (d *Player5LinuxDriver) Stop(vmxPath string) error {
return
nil
}
func
(
d
*
Player5LinuxDriver
)
SuppressMessages
(
vmxPath
string
)
error
{
return
nil
}
func
(
d
*
Player5LinuxDriver
)
Verify
()
error
{
if
err
:=
d
.
findApp
();
err
!=
nil
{
return
fmt
.
Errorf
(
"VMware Player application ('vmplayer') not found in path."
)
...
...
builder/vmware/driver_workstation9.go
View file @
e4f1dcb6
...
...
@@ -89,6 +89,10 @@ func (d *Workstation9Driver) Stop(vmxPath string) error {
return
nil
}
func
(
d
*
Workstation9Driver
)
SuppressMessages
(
vmxPath
string
)
error
{
return
nil
}
func
(
d
*
Workstation9Driver
)
Verify
()
error
{
var
err
error
if
d
.
AppPath
==
""
{
...
...
builder/vmware/step_suppress_messages.go
0 → 100644
View file @
e4f1dcb6
package
vmware
import
(
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"log"
)
// This step suppresses any messages that VMware product might show.
type
stepSuppressMessages
struct
{}
func
(
s
*
stepSuppressMessages
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmxPath
:=
state
.
Get
(
"vmx_path"
)
.
(
string
)
log
.
Println
(
"Suppressing messages in VMX"
)
if
err
:=
driver
.
SuppressMessages
(
vmxPath
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error suppressing messages: %s"
,
err
)
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
}
return
multistep
.
ActionContinue
}
func
(
s
*
stepSuppressMessages
)
Cleanup
(
state
multistep
.
StateBag
)
{}
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