func deleteServerKeyPair(t *testing.T, client *gophercloud.ServiceClient, k *oskey.KeyPair) {
	t.Logf("> keypairs.Delete")

	err := keypairs.Delete(client, k.Name).ExtractErr()
	th.AssertNoErr(t, err)

	t.Logf("Keypair deleted successfully.")
}
Beispiel #2
0
func (command *commandDelete) Execute(resource *handler.Resource) {
	keypairName := resource.Params.(*paramsDelete).keypair
	err := keypairs.Delete(command.Ctx.ServiceClient, keypairName).ExtractErr()
	if err != nil {
		resource.Err = err
		return
	}
	resource.Result = fmt.Sprintf("Successfully deleted keypair [%s]\n", keypairName)
}
Beispiel #3
0
func deleteKeyPair(t *testing.T, client *gophercloud.ServiceClient, name string) {
	err := keypairs.Delete(client, name).ExtractErr()
	th.AssertNoErr(t, err)
	t.Logf("Successfully deleted key [%s].", name)
}