Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added error check #99

Merged
merged 1 commit into from Oct 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions command/volume_create.go
Expand Up @@ -157,6 +157,10 @@ func CreateAPIVsm(vname string, size string) error {
fmt.Printf("Volume Spec Created:\n%v\n", string(yamlValue))

req, err := http.NewRequest("POST", url, bytes.NewBuffer(yamlValue))
if err != nil {
fmt.Printf("http.NewRequest() error: %v\n", err)
return err
}

req.Header.Add("Content-Type", "application/yaml")

Expand Down
4 changes: 4 additions & 0 deletions command/volume_stop.go
Expand Up @@ -163,6 +163,10 @@ func DeleteVsm(vname string) error {
url := addr + "/latest/volumes/delete/" + vname

req, err := http.NewRequest("GET", url, nil)
if err != nil {
fmt.Println("http.NewRequest() error: : %v", err)
return err
}
c := &http.Client{
Timeout: timeout,
}
Expand Down