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
96c81368
Commit
96c81368
authored
Nov 26, 2014
by
Seth Vargo
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1645 from vtolstov/qemu_disk
Allow none checksumtype for qemu builder
parents
a60039e7
4762075d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
builder/qemu/builder.go
builder/qemu/builder.go
+22
-13
No files found.
builder/qemu/builder.go
View file @
96c81368
...
@@ -122,6 +122,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
...
@@ -122,6 +122,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
warnings
:=
make
([]
string
,
0
)
b
.
config
.
tpl
,
err
=
packer
.
NewConfigTemplate
()
b
.
config
.
tpl
,
err
=
packer
.
NewConfigTemplate
()
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -304,22 +305,24 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
...
@@ -304,22 +305,24 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
errs
,
errors
.
New
(
"http_port_min must be less than http_port_max"
))
errs
,
errors
.
New
(
"http_port_min must be less than http_port_max"
))
}
}
if
b
.
config
.
ISOChecksum
==
""
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
errors
.
New
(
"Due to large file sizes, an iso_checksum is required"
))
}
else
{
b
.
config
.
ISOChecksum
=
strings
.
ToLower
(
b
.
config
.
ISOChecksum
)
}
if
b
.
config
.
ISOChecksumType
==
""
{
if
b
.
config
.
ISOChecksumType
==
""
{
errs
=
packer
.
MultiErrorAppend
(
errs
=
packer
.
MultiErrorAppend
(
errs
,
errors
.
New
(
"The iso_checksum_type must be specified."
))
errs
,
errors
.
New
(
"The iso_checksum_type must be specified."
))
}
else
{
}
else
{
b
.
config
.
ISOChecksumType
=
strings
.
ToLower
(
b
.
config
.
ISOChecksumType
)
b
.
config
.
ISOChecksumType
=
strings
.
ToLower
(
b
.
config
.
ISOChecksumType
)
if
h
:=
common
.
HashForType
(
b
.
config
.
ISOChecksumType
);
h
==
nil
{
if
b
.
config
.
ISOChecksumType
!=
"none"
{
errs
=
packer
.
MultiErrorAppend
(
if
b
.
config
.
ISOChecksum
==
""
{
errs
,
errs
=
packer
.
MultiErrorAppend
(
fmt
.
Errorf
(
"Unsupported checksum type: %s"
,
b
.
config
.
ISOChecksumType
))
errs
,
errors
.
New
(
"Due to large file sizes, an iso_checksum is required"
))
}
else
{
b
.
config
.
ISOChecksum
=
strings
.
ToLower
(
b
.
config
.
ISOChecksum
)
}
if
h
:=
common
.
HashForType
(
b
.
config
.
ISOChecksumType
);
h
==
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Unsupported checksum type: %s"
,
b
.
config
.
ISOChecksumType
))
}
}
}
}
}
...
@@ -404,11 +407,17 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
...
@@ -404,11 +407,17 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
b
.
config
.
QemuArgs
=
make
([][]
string
,
0
)
b
.
config
.
QemuArgs
=
make
([][]
string
,
0
)
}
}
if
b
.
config
.
ISOChecksumType
==
"none"
{
warnings
=
append
(
warnings
,
"A checksum type of 'none' was specified. Since ISO files are so big,
\n
"
+
"a checksum is highly recommended."
)
}
if
errs
!=
nil
&&
len
(
errs
.
Errors
)
>
0
{
if
errs
!=
nil
&&
len
(
errs
.
Errors
)
>
0
{
return
nil
,
errs
return
warnings
,
errs
}
}
return
nil
,
nil
return
warnings
,
nil
}
}
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
,
cache
packer
.
Cache
)
(
packer
.
Artifact
,
error
)
{
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
,
cache
packer
.
Cache
)
(
packer
.
Artifact
,
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