add more codes
This commit is contained in:
@@ -136,6 +136,9 @@ func (s *Store) SaveCT(spec lxc.Spec) error {
|
||||
if spec.ID == "" {
|
||||
return fmt.Errorf("ct id is required")
|
||||
}
|
||||
if spec.RootfsPool == "" {
|
||||
return fmt.Errorf("rootfs_pool is required")
|
||||
}
|
||||
data, err := yaml.Marshal(spec)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -3,8 +3,8 @@ package state
|
||||
import "testing"
|
||||
|
||||
func TestTrimExt(t *testing.T) {
|
||||
got := trimExt("foo.yaml")
|
||||
if got != "foo" {
|
||||
t.Fatalf("expected foo, got %s", got)
|
||||
}
|
||||
got := trimExt("foo.yaml")
|
||||
if got != "foo" {
|
||||
t.Fatalf("expected foo, got %s", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user