Skip to content

Commit

Permalink
Adding requested Changes.
Browse files Browse the repository at this point in the history
Removed all unneccessary comparison to true operators.
fixed case for username and password in readme.md

	modified:   README.md
	modified:   packer-provisioner-goss.go
  • Loading branch information
vamegh committed Feb 11, 2018
1 parent 9a68738 commit 5c54520
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ There is an example packer build with goss tests in the `example/` directory.
"skip_ssl": false,
"use_sudo": false,
"goss_file": "",
"Username": "",
"Password": "",
"username": "",
"password": "",
"debug": false
}
]
Expand Down
10 changes: 5 additions & 5 deletions packer-provisioner-goss.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
return fmt.Errorf("Error stating file: %s", err)
}

if s.Mode().IsRegular() == true {
if s.Mode().IsRegular() {
ui.Message(fmt.Sprintf("Uploading %s", src))
dst := filepath.ToSlash(filepath.Join(p.config.RemotePath, filepath.Base(src)))
if err := p.uploadFile(ui, comm, dst, src); err != nil {
return fmt.Errorf("Error uploading goss test: %s", err)
}
} else if s.Mode().IsDir() == true {
} else if s.Mode().IsDir() {
ui.Message(fmt.Sprintf("Uploading Dir %s", src))
dst := filepath.ToSlash(filepath.Join(p.config.RemotePath, filepath.Base(src)))
if err := p.uploadDir(ui, comm, dst, src); err != nil {
Expand Down Expand Up @@ -228,14 +228,14 @@ func (p *Provisioner) runGoss(ui packer.Ui, comm packer.Communicator) error {

// debug returns the debug flag if debug is configured
func (p *Provisioner) debug() string {
if p.config.Debug == true {
if p.config.Debug {
return "-d"
}
return ""
}

func (p *Provisioner) sslFlag(cmdType string) string {
if p.config.SkipSSLChk == true {
if p.config.SkipSSLChk {
switch(cmdType) {
case "curl":
return "-k"
Expand All @@ -250,7 +250,7 @@ func (p *Provisioner) sslFlag(cmdType string) string {

// enable sudo if required
func (p *Provisioner) enableSudo() string {
if p.config.UseSudo == true {
if p.config.UseSudo {
return "sudo"
}
return ""
Expand Down

0 comments on commit 5c54520

Please sign in to comment.