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
56318737
Commit
56318737
authored
Oct 31, 2014
by
Vasiliy Tolstov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow none checksumtype for qemu builder (copy/paste from virtualbox)
Signed-off-by:
Vasiliy Tolstov
<
v.tolstov@selfip.ru
>
parent
399837b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
builder/qemu/builder.go
builder/qemu/builder.go
+21
-13
No files found.
builder/qemu/builder.go
View file @
56318737
...
...
@@ -304,22 +304,24 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
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
==
""
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
errors
.
New
(
"The iso_checksum_type must be specified."
))
}
else
{
b
.
config
.
ISOChecksumType
=
strings
.
ToLower
(
b
.
config
.
ISOChecksumType
)
if
h
:=
common
.
HashForType
(
b
.
config
.
ISOChecksumType
);
h
==
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Unsupported checksum type: %s"
,
b
.
config
.
ISOChecksumType
))
if
b
.
config
.
ISOChecksumType
!=
"none"
{
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
h
:=
common
.
HashForType
(
b
.
config
.
ISOChecksumType
);
h
==
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Unsupported checksum type: %s"
,
b
.
config
.
ISOChecksumType
))
}
}
}
...
...
@@ -404,11 +406,17 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
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
{
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
)
{
...
...
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