Skip to content

Commit

Permalink
Merge pull request #38 from CiscoCloud/fix/handle-missing-package
Browse files Browse the repository at this point in the history
version 0.1.8
  • Loading branch information
ryane committed Mar 30, 2016
2 parents 962fb4e + 2b431de commit a64a7ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions install/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ func (install *Install) GetPackageDefinition(name string, version string, userCo
return nil, err
}

if pkg == nil {
return nil, errors.New(fmt.Sprintf("Could not find %s package", name))
}

pkgVersion := pkg.FindPackageVersion(version)
if pkgVersion == nil {
return nil, errors.New(fmt.Sprintf("Could not find installable version for %s", name))
Expand Down Expand Up @@ -443,6 +447,8 @@ func transformedConfigValue(val interface{}, typ string) interface{} {
switch typ {
case "integer":
return fmt.Sprintf("%d", int(val.(float64)))
case "number":
return fmt.Sprintf("%0.2f", val.(float64))
default:
return val
}
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

const Name = "mantl-api"
const Version = "0.1.7"
const Version = "0.1.8"

var wg sync.WaitGroup

Expand Down Expand Up @@ -199,7 +199,7 @@ func syncRepo(inst *install.Install, force bool) {
Name: "mantl",
Path: "https://github.com/CiscoCloud/mantl-universe.git",
SourceType: install.Git,
Branch: "version-0.6",
Branch: "version-0.7",
Index: 0,
},
}
Expand Down

0 comments on commit a64a7ac

Please sign in to comment.