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
ad51098a
Commit
ad51098a
authored
Sep 03, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer/rpc: don't panic on cache errors [GH-1328]
parent
e9c2628a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
CHANGELOG.md
CHANGELOG.md
+1
-0
packer/rpc/cache.go
packer/rpc/cache.go
+9
-4
No files found.
CHANGELOG.md
View file @
ad51098a
...
...
@@ -22,6 +22,7 @@ BUG FIXES:
*
core: nicer error message if an encrypted private key is used for
SSH. [GH-1445]
*
core: Fix crash that could happen with a well timed double Ctrl-C. [GH-1328]
*
builder/amazon-chroot: Can properly build HVM images now. [GH-1360]
*
builder/amazon-chroot: Fix crash in root device check. [GH-1360]
*
builder/amazon-instance: Fix deprecation warning for
`ec2-bundle-vol`
...
...
packer/rpc/cache.go
View file @
ad51098a
...
...
@@ -2,6 +2,7 @@ package rpc
import
(
"github.com/mitchellh/packer/packer"
"log"
"net/rpc"
)
...
...
@@ -24,7 +25,8 @@ type CacheRLockResponse struct {
func
(
c
*
cache
)
Lock
(
key
string
)
(
result
string
)
{
if
err
:=
c
.
client
.
Call
(
"Cache.Lock"
,
key
,
&
result
);
err
!=
nil
{
panic
(
err
)
log
.
Printf
(
"[ERR] Cache.Lock error: %s"
,
err
)
return
}
return
...
...
@@ -33,7 +35,8 @@ func (c *cache) Lock(key string) (result string) {
func
(
c
*
cache
)
RLock
(
key
string
)
(
string
,
bool
)
{
var
result
CacheRLockResponse
if
err
:=
c
.
client
.
Call
(
"Cache.RLock"
,
key
,
&
result
);
err
!=
nil
{
panic
(
err
)
log
.
Printf
(
"[ERR] Cache.RLock error: %s"
,
err
)
return
""
,
false
}
return
result
.
Path
,
result
.
Exists
...
...
@@ -41,13 +44,15 @@ func (c *cache) RLock(key string) (string, bool) {
func
(
c
*
cache
)
Unlock
(
key
string
)
{
if
err
:=
c
.
client
.
Call
(
"Cache.Unlock"
,
key
,
new
(
interface
{}));
err
!=
nil
{
panic
(
err
)
log
.
Printf
(
"[ERR] Cache.Unlock error: %s"
,
err
)
return
}
}
func
(
c
*
cache
)
RUnlock
(
key
string
)
{
if
err
:=
c
.
client
.
Call
(
"Cache.RUnlock"
,
key
,
new
(
interface
{}));
err
!=
nil
{
panic
(
err
)
log
.
Printf
(
"[ERR] Cache.RUnlock error: %s"
,
err
)
return
}
}
...
...
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