Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arity mismatch between MachineImage's :destroy and Driver#destroy_image #358

Closed
randomcamel opened this issue Jun 3, 2015 · 0 comments
Closed
Assignees
Labels
Type: Bug Doesn't work as expected.
Milestone

Comments

@randomcamel
Copy link
Contributor

arity-mismatch

Since this is a published API and third-party drivers might already be calling Driver#destroy_image with 3 arguments, the solution is to change

def destroy_image(action_handler, image_spec, image_options, machine_options)

to

def destroy_image(action_handler, image_spec, image_options, machine_options={})

(It's a separate question of whether machine_options makes sense here.)

In the meantime, drivers not implementing #destroy_image can work around this by overriding the superclass method:

def destroy_image(action_handler, image_spec, image_options, machine_options={})
    super(action_handler, image_spec, image_options, machine_options)
end

Which replaces the ArgumentError with a RuntimeError from the superclass which will give a correct and useful error message.

@randomcamel randomcamel added the bug label Jun 3, 2015
randomcamel pushed a commit to chef-boneyard/chef-provisioning-docker that referenced this issue Jun 4, 2015
randomcamel pushed a commit to chef-boneyard/chef-provisioning-docker that referenced this issue Jun 8, 2015
randomcamel pushed a commit to chef-boneyard/chef-provisioning-docker that referenced this issue Jun 8, 2015
@randomcamel randomcamel self-assigned this Jun 9, 2015
randomcamel added a commit that referenced this issue Jun 16, 2015
randomcamel pushed a commit to chef-boneyard/chef-provisioning-docker that referenced this issue Jun 16, 2015
@tyler-ball tyler-ball added this to the 1.2.1 milestone Jul 17, 2015
randomcamel added a commit that referenced this issue Aug 19, 2015
@tas50 tas50 added Type: Bug Doesn't work as expected. and removed Bug labels Jul 31, 2018
bglimepoint pushed a commit to bglimepoint/chef-provisioning that referenced this issue Oct 29, 2018
bglimepoint pushed a commit to bglimepoint/chef-provisioning that referenced this issue Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Doesn't work as expected.
Development

No branches or pull requests

3 participants