We dont use this gem anymore, and it is cause problems for folks who
are attempting to bundle install, as the last gem never made it to
rubygems.org. Removing this cause no errors for my, but would like
to see someone else verify the results (ie, everything still generally
works, installs, tests pass, etc)
I'm trying to document the deployable XML document structure. Based on the RelaxNG file in conductor, I've put together a mock deployable template (see attached).
I haven't indicated which elements/attribs are optional yet (nor in some cases, which elements allow for more than one), but how accurate is the basic hierarchy?
Engineering Content Services
Red Hat Asia Pacific Pty Ltd
From: Tomas Sedovic <tomas(a)sedovic.cz>
The UI used to allow the users to edit or delete backend HWPs.
This hides the Edit and Delete buttons from the UI for the Provider Hardware
Profiles and makes sure that they can't be deleted by issuing rogue HTTP
Additionally, we no longer show matching profiles for backend HWPs as that
doesn't make much sense.
We may want to show all the *frontend* profiles that match a given backend one,
but that's not part of this patch.
.../controllers/hardware_profiles_controller.rb | 10 ++++++++++
src/app/views/hardware_profiles/show.html.haml | 16 +++++++++-------
src/config/locales/en.yml | 3 +++
src/features/hardware_profile.feature | 13 +++++++++++++
.../step_definitions/hardware_profile_steps.rb | 10 ++++++++++
5 files changed, 45 insertions(+), 7 deletions(-)
diff --git a/src/app/controllers/hardware_profiles_controller.rb b/src/app/controllers/hardware_profiles_controller.rb
index 2d408bf..c15b3dc 100644
@@ -90,6 +90,11 @@ class HardwareProfilesController < ApplicationController
hardware_profile = HardwareProfile.find(params[:id])
+ if hardware_profile.provider_hardware_profile?
+ flash[:warning] = t "hardware_profiles.flash.warning.cannot_delete_backend_hwp"
+ redirect_to hardware_profile_path(hardware_profile)
flash[:notice] = t "hardware_profiles.flash.notice.deleted"
@@ -103,6 +108,11 @@ class HardwareProfilesController < ApplicationController
@hardware_profile = HardwareProfile.find(params[:id])
+ if @hardware_profile.provider_hardware_profile?
+ flash[:warning] = t "hardware_profiles.flash.warning.cannot_edit_backend_hwp"
+ redirect_to hardware_profile_path(@hardware_profile)
diff --git a/src/app/views/hardware_profiles/show.html.haml b/src/app/views/hardware_profiles/show.html.haml
index 6c0dd03..bcda4d3 100644
@@ -4,15 +4,17 @@
= link_to t('hardware_profiles.list.new_hardware'), new_hardware_profile_url, :class => 'button primary', :id => 'new_role_button'
- = link_to t('edit'), edit_hardware_profile_path(@hardware_profile), :class => 'button pill', :id => 'edit_button'
- = button_to t('delete'), hardware_profile_path(@hardware_profile), :method => :delete, :confirm => "Are you sure you want to delete?", :class => 'button pill danger'
+ - unless @hardware_profile.provider_hardware_profile?
+ = link_to t('edit'), edit_hardware_profile_path(@hardware_profile), :class => 'button pill', :id => 'edit_button'
+ = button_to t('delete'), hardware_profile_path(@hardware_profile), :method => :delete, :confirm => "Are you sure you want to delete?", :class => 'button pill danger'
= render :partial => 'properties'
- = render :partial => 'matching_provider_hardware_profiles'
+- unless @hardware_profile.provider_hardware_profile?
+ = render :partial => 'matching_provider_hardware_profiles'
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index bbb5f98..0a83548 100644
@@ -513,6 +513,9 @@ en:
not_deleted: "Hardware profile was not deleted!"
more_not_deleted: Could not deleted these Hardware Profiles
+ cannot_edit_backend_hwp: "Cannot modify Provider Hardware Profiles"
+ cannot_delete_backend_hwp: "Cannot delete Provider Hardware Profiles"
all_hardware_profiles: "All Hardware Profiles"
x86_64architecture: "x86_64 architecture"
diff --git a/src/features/hardware_profile.feature b/src/features/hardware_profile.feature
index c7b77db..41c72b5 100644
@@ -174,3 +174,16 @@ Feature: Manage Hardware Profiles
And I press "apply_hardware_profiles_search"
Then I should see "myhardware_profile"
And I should not see "somehardware_profile"
+ Scenario: Prevent modification of Backend Hardware Profiles
+ Given there are the following conductor hardware profiles:
+ | name | memory | cpu |storage | architecture |
+ | m1-small | 1740 | 2 | 160 | i386 |
+ And the Hardare Profile "m1-small" has the following Provider Hardware Profiles:
+ | name | memory | cpu |storage | architecture |
+ | b1-small | 1740 | 2 | 160 | i386 |
+ And I am on the hardware profiles page
+ When I follow "m1-small"
+ And I follow "b1-small"
+ Then I should not see the edit button
+ And I should not see the delete button
diff --git a/src/features/step_definitions/hardware_profile_steps.rb b/src/features/step_definitions/hardware_profile_steps.rb
index dda2220..be3c4a8 100644
@@ -83,3 +83,13 @@ Then /^I should see the hardware profiles table$/ do
+Then /^I should not see the edit button$/ do
+ page.should have_no_selector('#edit_button')
+Then /^I should not see the delete button$/ do
+ within('#obj_actions') do
+ page.should have_no_selector('input[value=delete]')
At the suggestion of jclift, I am resending this email as its own
thread in the hopes that more people will notice it.
I am a bit disconcerted by the number of 'self-acks' I have been
seeing on list lately. I know there were some complaints about speed
of reviews a while back, which led (I thought) to the community
agreeing that if you had a trivial fix/patch that you were confident
broke nothing, you could go ahead and push. This was not meant, in my
estimation anyway, to give everyone open license to just push whatever
they want with no review. We should still be reviewing and testing
patches properly, and if you have something that has been sitting on
list waiting for review (like, ahem, my mysql-fixing patch, someone
please look at it!), it is up to you to make a nuisance of yourself in
whatever way you want until you get a reviewer to work with you.
This is not directed at anyone specific, there have just been too many
of late, and I could not sit quietly and watch them go by anymore.