style fixes

This commit is contained in:
Preetha Appan 2018-10-17 22:45:40 -05:00
parent 12278527c7
commit b97f85e3e0
No known key found for this signature in database
GPG Key ID: 9F7C19990A50EAFC
1 changed files with 4 additions and 8 deletions

View File

@ -295,8 +295,7 @@ func (op *Operator) SchedulerSetConfiguration(args *structs.SchedulerSetConfigRe
rule, err := op.srv.ResolveToken(args.AuthToken)
if err != nil {
return err
}
if rule != nil && !rule.AllowOperatorWrite() {
} else if rule != nil && !rule.AllowOperatorWrite() {
return structs.ErrPermissionDenied
}
@ -305,8 +304,7 @@ func (op *Operator) SchedulerSetConfiguration(args *structs.SchedulerSetConfigRe
if err != nil {
op.logger.Error("failed applying Scheduler configuration", "error", err)
return err
}
if respErr, ok := resp.(error); ok {
} else if respErr, ok := resp.(error); ok {
return respErr
}
@ -327,8 +325,7 @@ func (op *Operator) SchedulerGetConfiguration(args *structs.GenericRequest, repl
rule, err := op.srv.ResolveToken(args.AuthToken)
if err != nil {
return err
}
if rule != nil && !rule.AllowOperatorRead() {
} else if rule != nil && !rule.AllowOperatorRead() {
return structs.ErrPermissionDenied
}
@ -336,8 +333,7 @@ func (op *Operator) SchedulerGetConfiguration(args *structs.GenericRequest, repl
_, config, err := state.SchedulerConfig()
if err != nil {
return err
}
if config == nil {
} else if config == nil {
return fmt.Errorf("scheduler config not initialized yet")
}