resources: Unify resource creation and kind setting

This removes the duplication of the kind string and cleans up things for
resource creation.
This commit is contained in:
James Shubin
2017-06-07 02:26:14 -04:00
parent 2f6c77fba2
commit b8ff6938df
30 changed files with 60 additions and 108 deletions

View File

@@ -20,7 +20,6 @@ package resources
import (
"bufio"
"bytes"
"encoding/gob"
"fmt"
"log"
"os/exec"
@@ -34,7 +33,6 @@ import (
)
func init() {
gob.Register(&ExecRes{})
RegisterResource("exec", func() Res { return &ExecRes{} })
}
@@ -73,7 +71,6 @@ func (obj *ExecRes) Validate() error {
// Init runs some startup code for this resource.
func (obj *ExecRes) Init() error {
obj.BaseRes.Kind = "exec"
return obj.BaseRes.Init() // call base init, b/c we're overriding
}