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
25183e77
Commit
25183e77
authored
Aug 01, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioner/salt-masterless: remove Ui
/cc @rgarcia Should just pass it in as a param
parent
0f2dfb1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
provisioner/salt-masterless/provisioner.go
provisioner/salt-masterless/provisioner.go
+4
-6
No files found.
provisioner/salt-masterless/provisioner.go
View file @
25183e77
...
...
@@ -12,8 +12,6 @@ import (
"strings"
)
var
Ui
packer
.
Ui
const
DefaultTempConfigDir
=
"/tmp/salt"
type
Config
struct
{
...
...
@@ -81,7 +79,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
}
ui
.
Message
(
fmt
.
Sprintf
(
"Uploading local state tree: %s"
,
p
.
config
.
LocalStateTree
))
if
err
=
UploadLocalDirectory
(
p
.
config
.
LocalStateTree
,
p
.
config
.
TempConfigDir
,
comm
);
err
!=
nil
{
if
err
=
UploadLocalDirectory
(
p
.
config
.
LocalStateTree
,
p
.
config
.
TempConfigDir
,
comm
,
ui
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Error uploading local state tree to remote: %s"
,
err
)
}
...
...
@@ -106,7 +104,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
return
nil
}
func
UploadLocalDirectory
(
localDir
string
,
remoteDir
string
,
comm
packer
.
Communicator
)
(
err
error
)
{
func
UploadLocalDirectory
(
localDir
string
,
remoteDir
string
,
comm
packer
.
Communicator
,
ui
packer
.
Ui
)
(
err
error
)
{
visitPath
:=
func
(
localPath
string
,
f
os
.
FileInfo
,
err
error
)
(
err2
error
)
{
localRelPath
:=
strings
.
Replace
(
localPath
,
localDir
,
""
,
1
)
remotePath
:=
fmt
.
Sprintf
(
"%s%s"
,
remoteDir
,
localRelPath
)
...
...
@@ -116,7 +114,7 @@ func UploadLocalDirectory(localDir string, remoteDir string, comm packer.Communi
if
f
.
IsDir
()
{
// Make remote directory
cmd
:=
&
packer
.
RemoteCmd
{
Command
:
fmt
.
Sprintf
(
"mkdir -p %s"
,
remotePath
)}
if
err
=
cmd
.
StartWithUi
(
comm
,
U
i
);
err
!=
nil
{
if
err
=
cmd
.
StartWithUi
(
comm
,
u
i
);
err
!=
nil
{
return
err
}
}
else
{
...
...
@@ -127,7 +125,7 @@ func UploadLocalDirectory(localDir string, remoteDir string, comm packer.Communi
}
defer
file
.
Close
()
U
i
.
Message
(
fmt
.
Sprintf
(
"Uploading file %s: %s"
,
localPath
,
remotePath
))
u
i
.
Message
(
fmt
.
Sprintf
(
"Uploading file %s: %s"
,
localPath
,
remotePath
))
if
err
=
comm
.
Upload
(
remotePath
,
file
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Error uploading file: %s"
,
err
)
}
...
...
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