Giter VIP home page Giter VIP logo

Comments (7)

knowncitizen avatar knowncitizen commented on September 27, 2024

@tzumainn do you happen to know if we need to do some prep to delete this? does this look like something that should work within egon directly?

from egon.

tzumainn avatar tzumainn commented on September 27, 2024

@sdherr, @knowncitizen: it looks like the proper method name is actually destroy:

https://github.com/fog/fog/blob/master/lib/fog/openstack/models/baremetal/nodes.rb#L29

I suspect the reason for the method name is to make it consistent with other non-openstack node models in fog.

If that doesn't solve the problem, please add some additional information about what error results. Thanks!

from egon.

sdherr avatar sdherr commented on September 27, 2024

@knowncitizen, @tzumainn, "destroy" is the correct method name, thanks, but it doesn't work. Notice in the nodes.rb file you linked above, it's doing a "find_by_id" instead of "find_by_uuid", which is not defined and results in the error below. Is there any other way to make this work?

Excon::Errors::BadRequest: Expected([200, 204]) <=> Actual(400 Bad Request)
excon.error.response
:body => "{"error_message": "{\"debuginfo\": null, \"faultcode\": \"Client\", \"faultstring\": \"Unknown argument: \\"id\\"\"}"}"
:headers => {
"Content-Length" => "120"
"Content-Type" => "application/json"
"Date" => "Mon, 26 Oct 2015 21:23:12 GMT"
"Server" => "WSGIServer/0.1 Python/2.7.5"
"X-OpenStack-Ironic-API-Maximum-Version" => "1.6"
"X-OpenStack-Ironic-API-Minimum-Version" => "1.1"
"X-OpenStack-Ironic-API-Version" => "1.1"
}
:local_address => "192.168.121.226"
:local_port => 52667
:reason_phrase => "Bad Request"
:remote_ip => "192.0.2.1"
:status => 400
:status_line => "HTTP/1.0 400 Bad Request\r\n"

from /opt/rh/ruby193/root/usr/share/gems/gems/excon-0.45.3/lib/excon/middlewares/expects.rb:10:in `response_call'
from /opt/rh/ruby193/root/usr/share/gems/gems/excon-0.45.3/lib/excon/middlewares/response_parser.rb:8:in `response_call'
from /opt/rh/ruby193/root/usr/share/gems/gems/excon-0.45.3/lib/excon/connection.rb:372:in `response'
from /opt/rh/ruby193/root/usr/share/gems/gems/excon-0.45.3/lib/excon/connection.rb:236:in `request'
from /opt/rh/ruby193/root/usr/share/gems/gems/fog-core-1.32.0/lib/fog/core/connection.rb:81:in `request'
from /opt/rh/ruby193/root/usr/share/gems/gems/fog-1.32.0/lib/fog/openstack/baremetal.rb:295:in `request'
from /opt/rh/ruby193/root/usr/share/gems/gems/fog-1.32.0/lib/fog/openstack/requests/baremetal/list_nodes_detailed.rb:10:in `list_nodes_detailed'
from /opt/rh/ruby193/root/usr/share/gems/gems/fog-1.32.0/lib/fog/openstack/models/baremetal/nodes.rb:36:in `method_missing'
from /opt/rh/ruby193/root/usr/share/gems/gems/fog-1.32.0/lib/fog/openstack/models/baremetal/nodes.rb:30:in `destroy'
from /home/sherr/egon/lib/egon/overcloud/undercloud_handle/node.rb:23:in `delete_node'
from (irb):13
from /opt/rh/ruby193/root/usr/bin/irb:12:in `<main>'

from egon.

tzumainn avatar tzumainn commented on September 27, 2024

Ugh - that's a clear bug in fog. It should work if patched to use find_by_uuid. My best suggestion is to submit a patch to Fog, and to wait for a new Fog version.

If you're impatient, you can also do a temporary workaround, similar to what I did to accommodate for the fact that the ironic-discoverd service was not yet registered in keystone:

https://github.com/fusor/egon/blob/master/lib/egon/overcloud/undercloud_handle/node.rb#L78

The Ironic REST API documentation specifies the url and request you need to delete a node:

http://docs.openstack.org/developer/ironic/webapi/v1.html

from egon.

sdherr avatar sdherr commented on September 27, 2024

I submitted a PR for fog: https://github.com/fog/fog/pull/3735/files

RHCI will be ship with a patched version of fog that includes this fix, so for our purposes we can just assume that fog works correctly. I'll submit a PR for egon to add the delete_node method.

from egon.

knowncitizen avatar knowncitizen commented on September 27, 2024

Will be fixed with #48

from egon.

knowncitizen avatar knowncitizen commented on September 27, 2024

Fixed with #48 thanks to @jmontleon

from egon.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.