Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Move version check into validateTask()
Browse files Browse the repository at this point in the history
  • Loading branch information
geauxvirtual committed Aug 22, 2016
1 parent e679a34 commit ce765fc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/snapctl/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,6 @@ func (t *task) mergeCliOptions(ctx *cli.Context) error {
}
t.MaxFailures = maxFailures
}
// shouldn't ever happen, but...
if t.Version != 1 {
return fmt.Errorf("Invalid version provided while creating task")
}
// set the schedule for the task from the CLI options (and return the results
// of that method call, indicating whether or not an error was encountered while
// setting up that schedule)
Expand Down Expand Up @@ -709,6 +705,9 @@ func validateTask(t task) error {
if err := validateScheduleExists(t.Schedule); err != nil {
return err
}
if t.Version != 1 {
return fmt.Errorf("Error: Invalid version provided for task manifest")
}
return nil
}

Expand Down

0 comments on commit ce765fc

Please sign in to comment.