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

Handle picture correctly on service template update/create #18674

Merged

Conversation

d-m-u
Copy link
Contributor

@d-m-u d-m-u commented Apr 23, 2019

We're not creating service templates with pictures correctly (or updating them) because the template is expecting a picture and instead gets a hash of options to create the picture.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1683723

@d-m-u
Copy link
Contributor Author

d-m-u commented Apr 23, 2019

@miq-bot assign @jrafanie

@d-m-u
Copy link
Contributor Author

d-m-u commented Apr 23, 2019

@miq-bot add_label bug
@miq-bot add_label hammer/yes

@d-m-u d-m-u changed the title Handle picture correctly on update/create Handle picture correctly on service template update/create Apr 23, 2019
@@ -509,7 +513,10 @@ def resource_action_list

def update_from_options(params)
options[:config_info] = params[:config_info]
update_attributes!(params.except(:config_info))
if params[:picture]
update_attributes!(:picture => Picture.create(:content => params[:picture][:content], :extension => 'jpg'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we only support jpg? If not, how do we know the extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh, fine, no, to the first: https://github.com/ManageIQ/manageiq/blob/master/app/models/picture.rb#L5 and ugh, fine, i guess it's we assume it's in the params too? maaaaaybe?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? I don't know how we create pictures.

@jrafanie
Copy link
Member

Looks good, only had a question above.

@d-m-u d-m-u force-pushed the fix_creating_service_template_with_picture branch from e11a5e5 to b74de6e Compare April 23, 2019 16:03
@miq-bot
Copy link
Member

miq-bot commented Apr 23, 2019

Checked commit d-m-u@b74de6e with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍪

@d-m-u d-m-u closed this Apr 23, 2019
@d-m-u d-m-u reopened this Apr 23, 2019
@jrafanie jrafanie merged commit d26ae5a into ManageIQ:master Apr 23, 2019
@jrafanie jrafanie added this to the Sprint 110 Ending Apr 29, 2019 milestone Apr 23, 2019
@d-m-u d-m-u deleted the fix_creating_service_template_with_picture branch April 23, 2019 18:25
simaishi pushed a commit that referenced this pull request Apr 23, 2019
…th_picture

Handle picture correctly on service template update/create

(cherry picked from commit d26ae5a)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1702479
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit 8174dc3bbaf02b95971b941a670fc5c4e1921b52
Author: Joe Rafaniello <[email protected]>
Date:   Tue Apr 23 14:25:10 2019 -0400

    Merge pull request #18674 from d-m-u/fix_creating_service_template_with_picture
    
    Handle picture correctly on service template update/create
    
    (cherry picked from commit d26ae5a0035a6ecead52e2850557e28e829f6f41)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1702479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants