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

Support sysprep for windows templates #2479

Merged
merged 1 commit into from
Oct 27, 2017

Conversation

pkliczewski
Copy link
Contributor

@pkliczewski pkliczewski commented Oct 20, 2017

We want to let the user to upload sysprep xml directly from
the customize tab in the same way as we do for vmware.

Bug-Url:
https://bugzilla.redhat.com/1323289

@miq-bot miq-bot added the wip label Oct 20, 2017
@pkliczewski pkliczewski changed the title [WIP] allow to upload sysprep files for windows vms Support sysprep for windows templates Oct 23, 2017
@pkliczewski
Copy link
Contributor Author

@miq-bot miq-bot removed the wip label Oct 23, 2017
@pkliczewski
Copy link
Contributor Author

@martinpovolny please review

@pkliczewski
Copy link
Contributor Author

@miq-bot assign @martinpovolny

@pkliczewski
Copy link
Contributor Author

This PR depends on ManageIQ/manageiq#16263

@@ -297,7 +335,7 @@
:label => _("Custom Specification"),
:prefix => "/miq_request/",
:keys => keys})
- if (!@options && @edit && @edit[:new] && @edit[:new][:sysprep_enabled] && @edit[:new][:sysprep_enabled][0] && @edit[:new][:sysprep_enabled][0] != "disabled") || (!@edit && @options && @options[:sysprep_enabled] && @options[:sysprep_enabled][0] && @options[:sysprep_enabled][0] != "disabled")
- if ((!@options && @edit && @edit[:new] && @edit[:new][:sysprep_enabled] && @edit[:new][:sysprep_enabled][0] && @edit[:new][:sysprep_enabled][0] != "disabled") || (!@edit && @options && @options[:sysprep_enabled] && @options[:sysprep_enabled][0] && @options[:sysprep_enabled][0] != "disabled")) && !wf.kind_of?(ManageIQ::Providers::Redhat::InfraManager::ProvisionWorkflow)
Copy link
Member

Choose a reason for hiding this comment

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

this line is getting even longer than before

can you extract that to a (helper) method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@martinpovolny Where do you propose to extract this condition to? This condition needs to be checked for ovirt and vmware provider.

@martinpovolny
Copy link
Member

@pkliczewski : can you get someone from your group to tests this? (in the browser)

@@ -180,7 +180,7 @@
:prefix => "/miq_request/",
:keys => keys})
- when :customize
- if wf.kind_of?(ManageIQ::Providers::Vmware::InfraManager::ProvisionWorkflow) && !wf.supports_pxe? && !wf.supports_iso?
- if (wf.kind_of?(ManageIQ::Providers::Vmware::InfraManager::ProvisionWorkflow) || wf.kind_of?(ManageIQ::Providers::Redhat::InfraManager::ProvisionWorkflow)) && !wf.supports_pxe? && !wf.supports_iso?
Copy link
Member

Choose a reason for hiding this comment

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

this looks like a pretty complex condition to be in a template, can you extract that to a (helper) method, please?

Copy link
Member

Choose a reason for hiding this comment

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

btw does this condition represent some property of the provider? or the workflow? maybe it shoudl be pushed even deeper in the model?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This condition checks only the type of the workflow. We want to have similar customize tab as there is for vmware.

@martinpovolny
Copy link
Member

The travis failure is unrelated.

@martinpovolny
Copy link
Member

any chance of adding at least a trivial spec for this?

@pkliczewski
Copy link
Contributor Author

Will check whether there is existing spec for this and if so I will add new one.

We want to let the user to upload sysprep xml directly from
the customize tab in the same way as we do for vmware.

Bug-Url:
https://bugzilla.redhat.com/1323289
@miq-bot
Copy link
Member

miq-bot commented Oct 26, 2017

Checked commit pkliczewski@861edec with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 4 offenses detected

app/controllers/catalog_controller.rb

app/controllers/miq_request_controller.rb

app/views/shared/views/_prov_dialog.html.haml

  • ⚠️ - Line 221 - Line is too long. [176/160]
  • ⚠️ - Line 338 - Avoid more than 3 levels of block nesting.

@martinpovolny
Copy link
Member

Looks good!. The CC issue can be ignored. Can be merged once tested. I don't have the capacity to test this right now :-(

@mwperina
Copy link

I tested this, in the UI, it works as expected.

@martinpovolny martinpovolny merged commit 7e79b48 into ManageIQ:master Oct 27, 2017
@martinpovolny martinpovolny added this to the Sprint 72 Ending Oct 30, 2017 milestone Oct 27, 2017
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