示例#1
0
文件: secret.go 项目: johan--/flynn
func (s *VirSecret) Undefine() error {
	result := C.virSecretUndefine(s.ptr)
	if result == -1 {
		return errors.New(GetLastError())
	}
	return nil
}
示例#2
0
// Undefine deletes the specified secret. This does not free the associated
// "Secret" object.
func (sec Secret) Undefine() error {
	sec.log.Println("undefining secret...")
	cRet := C.virSecretUndefine(sec.virSecret)
	ret := int(cRet)

	if ret == -1 {
		err := LastError()
		sec.log.Printf("an error occurred: %v\n", err)
		return err
	}

	sec.log.Println("secret undefined")

	return nil
}