Skip to content

Instantly share code, notes, and snippets.

@ponsfrilus
Forked from domq/test.rb
Created April 13, 2015 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ponsfrilus/7187c60109951648afb8 to your computer and use it in GitHub Desktop.
Save ponsfrilus/7187c60109951648afb8 to your computer and use it in GitHub Desktop.
# coding: utf-8
# TODO: turn this into a "rails runner" script
FakeRequest = Struct.new(:parameters)
r = FakeRequest.new
r.parameters = {
:id => 1,
"foreman_setup_provisioner" => {
"hostgroup_attributes" => {
"id" => 1,
"medium_id" => 1
},
"activation_key" => { "value" => "" },
"satellite_type" => { "value" => "" },
},
"medium_type" => "path"
}
c = ForemanSetup::ProvisionersController.new()
c.request = r
class ForemanSetup::ProvisionersController
def process_success(ignored)
end
end
c.instance_variable_set(:@provisioner, ForemanSetup::Provisioner.find_by_provision_interface("eth0"))
c.step4_update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment