https://bugzilla.redhat.com/show_bug.cgi?id=766012
by Greg Blomquist
Instead of throwing a 500 error, throw a 404 from the config server when trying
to delete configs that don't exist.
Version bump to config server: 0.4.3-1
(self-ack and push to master)
12 years, 6 months
[PATCH conductor] fix for BZ #761509: User quota and other stats
by Scott Seago
The summary page at /pools was giving confusing (and incorrect) stats. Changes are as follows:
Pools:
before: number of pools the user has view permissions on
after: number of pools the user has permission to launch deployments in
Deployments:
before: number of deployments the user has view permission on
after: number of deployments owned (i.e. launched) by the user
Instances:
before: number of instances the user has view permissions on
after: number of instances owned (i.e. launched) by the user
Quota Used:
before: aggregated stats for environment quotas on all environments
that the user has view permisions on. This was the cause
of the BZ report, as by default, non-admin users have no
direct permissions on the default environment -- only on
the contained default pool. So for non-admin users
this showed 0 of 0, since it was an aggregation over
0 environments.
after: user quota stats.
I've also updated the labels for the Overview to show "User Quota Usage" instead of "Quota Usage" and, for the Pool view, "Pool Quota Usage" instead of "Quota Usage" to clarify which quota measurement is being applied.
---
src/app/controllers/pools_controller.rb | 14 ++++++--------
src/app/views/pools/_scoreboard_index.html.haml | 10 ++++++----
src/app/views/pools/_scoreboard_show.html.haml | 4 +++-
src/features/pool.feature | 2 +-
src/features/step_definitions/instance_steps.rb | 6 ++++++
5 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/src/app/controllers/pools_controller.rb b/src/app/controllers/pools_controller.rb
index cc13278..3918d14 100644
--- a/src/app/controllers/pools_controller.rb
+++ b/src/app/controllers/pools_controller.rb
@@ -35,8 +35,7 @@ class PoolsController < ApplicationController
clear_breadcrumbs
save_breadcrumb(pools_path(:viewstate => viewstate_id))
- @user_pools = Pool.list_for_user(current_user, Privilege::VIEW)
- @user_pool_families = PoolFamily.list_for_user(current_user, Privilege::VIEW)
+ @user_pools = Pool.list_for_user(current_user, Privilege::CREATE, Deployment)
if filter_view?
@tabs = [{:name => "#{t'pools.pools'}", :view => 'list', :id => 'pools'},
{:name => "#{t'deployments.deployments'}", :view => 'deployments/list', :id => 'deployments'},
@@ -295,18 +294,17 @@ class PoolsController < ApplicationController
end
def statistics
- instances = Instance.list_for_user(current_user, Privilege::VIEW)
- pf_max_quotas = @user_pool_families.collect {|pf| pf.quota.maximum_running_instances}
+ instances = current_user.owned_instances
@failed_instances = instances.select {|instance| instance.state == Instance::STATE_CREATE_FAILED || instance.state == Instance::STATE_ERROR}
@statistics = {
:pools_in_use => @user_pools.collect { |pool| pool.instances.pending.count > 0 || pool.instances.deployed.count > 0 }.count,
- :deployments => Deployment.list_for_user(current_user, Privilege::VIEW).count,
+ :deployments => current_user.deployments.count,
:instances => instances.count,
:instances_pending => instances.select {|instance| instance.state == Instance::STATE_NEW || instance.state == Instance::STATE_PENDING}.count,
:instances_failed => @failed_instances.count,
- :pf_available_quota => pf_max_quotas.compact.size != @user_pool_families.size ? nil : @user_pool_families.collect{|pf| pf.quota.maximum_running_instances}.inject(0){|sum, n| sum + n},
- :pf_running_instances => @user_pool_families.collect{|pf| pf.quota.running_instances}.inject(0){|sum, n| sum + n},
- :pf_used_percentage => @user_pool_families.collect {|pf| pf.quota.percentage_used}.inject(0){|sum, n| sum + n}
+ :user_available_quota => current_user.quota.maximum_running_instances,
+ :user_running_instances => current_user.quota.running_instances,
+ :user_used_percentage => current_user.quota.percentage_used
}
end
end
diff --git a/src/app/views/pools/_scoreboard_index.html.haml b/src/app/views/pools/_scoreboard_index.html.haml
index 4987850..f264dd5 100644
--- a/src/app/views/pools/_scoreboard_index.html.haml
+++ b/src/app/views/pools/_scoreboard_index.html.haml
@@ -19,9 +19,11 @@
%dt= t("alerts_label")
%dd.count.alert= @statistics[:instances_failed]
%li
- %dt= t("quota_used")
- %dd.percentage.quota= number_to_percentage(@statistics[:pf_used_percentage], :precision => 0)
+ %dt
+ = t("user")
+ = t("quota_used")
+ %dd.percentage.quota= number_to_percentage(@statistics[:user_used_percentage], :precision => 0)
%dd.fraction.instance
- %span.part= @statistics[:pf_running_instances]
+ %span.part= @statistics[:user_running_instances]
%span.divider.label.small.caps of
- %span.total= @statistics[:pf_available_quota].nil? ? raw('∞') : @statistics[:pf_available_quota]
+ %span.total= @statistics[:user_available_quota].nil? ? raw('∞') : @statistics[:user_available_quota]
diff --git a/src/app/views/pools/_scoreboard_show.html.haml b/src/app/views/pools/_scoreboard_show.html.haml
index 86def34..8bba937 100644
--- a/src/app/views/pools/_scoreboard_show.html.haml
+++ b/src/app/views/pools/_scoreboard_show.html.haml
@@ -21,7 +21,9 @@
%dt=t'updates'
%dd.count.update 0
%li
- %dt=t'quota_used'
+ %dt
+ = t("pool")
+ = t("quota_used")
%dd.percentage.quota
= number_to_percentage((a)pool.quota.percentage_used, :precision => 0)
%dd.fraction.instance
diff --git a/src/features/pool.feature b/src/features/pool.feature
index c436caf..b52d7f6 100644
--- a/src/features/pool.feature
+++ b/src/features/pool.feature
@@ -168,7 +168,7 @@ Feature: Manage Pools
Then I should see "Your Pools" within "section.pools"
Scenario: Display alerts
- And there is a "fail1" failed instance
+ And there is a "fail1" failed instance owned by "admin"
When I go to the pools page
Then I should see "Alerts"
And I should see "Instance Failure error"
diff --git a/src/features/step_definitions/instance_steps.rb b/src/features/step_definitions/instance_steps.rb
index 3c50c2f..fbad005 100644
--- a/src/features/step_definitions/instance_steps.rb
+++ b/src/features/step_definitions/instance_steps.rb
@@ -68,6 +68,12 @@ Given /^there is a "([^"]*)" failed instance$/ do |name|
FactoryGirl.create :instance, :name => name, :state => Instance::STATE_ERROR
end
+Given /^there is a "([^"]*)" failed instance owned by "([^"]*)"$/ do |name, login|
+ instance = FactoryGirl.create :instance, :name => name, :state => Instance::STATE_ERROR
+ instance.owner = User.find_by_login(login)
+ instance.save
+end
+
Given /^there is a "([^"]*)" running instance$/ do |name|
FactoryGirl.create :instance, :name => name, :state => Instance::STATE_RUNNING
end
--
1.7.6.4
12 years, 6 months
[PATCH conductor] Fixing launch button on Deployables#show
by Imre Farkas
From: Imre Farkas <ifarkas(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=759044
---
src/app/stylesheets/custom.scss | 14 ++++++++++++++
src/app/views/deployables/show.html.haml | 2 +-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/app/stylesheets/custom.scss b/src/app/stylesheets/custom.scss
index f3ce3bc..2e0f592 100644
--- a/src/app/stylesheets/custom.scss
+++ b/src/app/stylesheets/custom.scss
@@ -100,6 +100,20 @@
overflow: hidden;
}
+#obj_actions.button-container{
+ #launch_deployment_button {
+ margin-left: 20px;
+ background: url(../../images/launch-button.png) no-repeat center;
+ background-size: cover; -webkit-background-size: cover; -moz-background-size: cover;
+ width: 73px;
+ height: 27px;
+ display: inline-block;
+
+ // Hide the text visually but keep it available for screen readers and such
+ text-indent: -3000px;
+ }
+}
+
.pool_details {
color: #333;
text-decoration: none;
diff --git a/src/app/views/deployables/show.html.haml b/src/app/views/deployables/show.html.haml
index f89ac19..be21515 100644
--- a/src/app/views/deployables/show.html.haml
+++ b/src/app/views/deployables/show.html.haml
@@ -6,7 +6,7 @@
= button_to t('catalog_entries.show.delete'), catalog_deployable_path(@catalog, @deployable), :method => 'delete', :confirm => "#{t'catalog_entries.show.confirm_delete'}", :class => 'button danger', :id => 'delete'
= link_to t('catalog_entries.show.edit'), edit_catalog_deployable_path(@catalog, @deployable), :class => 'button', :id => 'edit_button'
- = link_to t('deployments.overview.launch'), launch_new_deployments_path(:deployable_id => @deployable.id, :pool_id => @catalog.pool), :id => :launch_deployment
+ = link_to t('deployments.overview.launch'), launch_new_deployments_path(:deployable_id => @deployable.id, :pool_id => @catalog.pool), :id => :launch_deployment_button
%section.admin-content-section
%header
--
1.7.6.4
12 years, 6 months
[PATCH conductor] Fixing deployment card on Pools#index
by Imre Farkas
From: Imre Farkas <ifarkas(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=761437
---
src/app/stylesheets/custom.scss | 5 -----
src/app/stylesheets/layout.scss | 13 ++++++++++---
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/app/stylesheets/custom.scss b/src/app/stylesheets/custom.scss
index 2943ce4..b9c4906 100644
--- a/src/app/stylesheets/custom.scss
+++ b/src/app/stylesheets/custom.scss
@@ -102,11 +102,6 @@
background: url(../../images/loading.gif) no-repeat center;
}
-/*enhance height of deployment array because of uptimes to fit*/
-ul.deployment-array.small li.deployment {
- height: 90px;
-}
-
.hidden {
display: none;
}
diff --git a/src/app/stylesheets/layout.scss b/src/app/stylesheets/layout.scss
index f999fa9..9d67a87 100644
--- a/src/app/stylesheets/layout.scss
+++ b/src/app/stylesheets/layout.scss
@@ -2199,7 +2199,7 @@ ul.deployment-array.large + ul.deployment-array.large{
/********************************************* Small Deployable Card Arrays */
/************************************************************************** */
-$deployment-small-height: 84px;
+$deployment-small-height: 116px;
$deployment-small-width: 174px;
$deployment-small-padding: 8px;
@@ -2230,8 +2230,15 @@ ul.deployment-array.small{
dl.statistics{
ul{list-style: none;}
li{display: inline-block;}
- li.left{text-align: left;}
- li.right{text-align: right; float: right;}
+ li.left{
+ text-align: left;
+ width: 50%;
+ }
+ li.right{
+ text-align: right;
+ float: right;
+ width: 50%;
+ }
dt{font-size: 9px; text-transform: uppercase; padding: 4px; color: #999; display: block; margin-bottom: 4px;}
dt.uptime{
padding-left: 20px;
--
1.7.6.4
12 years, 6 months
[PATCH audrey]
by Dan Radez
BZ 765854
Making the agent fault tolerant of the network services on a host not being started
Also generally increasing test coverage on the agent
12 years, 6 months
[PATCH conductor] Allow changing deployment name on the Overview page
by Tomas Sedovic
From: Tomas Sedovic <tomas(a)sedovic.cz>
https://bugzilla.redhat.com/show_bug.cgi?id=751024
When a deployment is launched via catalog or the deployable details page, its
name is set as the underlying deployable's name.
Previously there wasn't a way to change the name, which meant that the user
couldn't launch a second deployment using the same way.
Now the deployable overview page has a field where the name can be changed.
---
src/app/stylesheets/custom.scss | 9 +++++++++
src/app/views/deployments/_overview.html.haml | 9 ++++++---
src/config/locales/en.yml | 1 +
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/app/stylesheets/custom.scss b/src/app/stylesheets/custom.scss
index 2943ce4..f3ce3bc 100644
--- a/src/app/stylesheets/custom.scss
+++ b/src/app/stylesheets/custom.scss
@@ -60,6 +60,15 @@
list-style-type: none;
margin-top: 4px;
}
+ input[type="text"] {
+ padding: 4px;
+ width: 200px;
+ font-size: 13px;
+ border: 1px solid #c4c4c4;
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
+ -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
+ }
}
.image-id {
diff --git a/src/app/views/deployments/_overview.html.haml b/src/app/views/deployments/_overview.html.haml
index e8da927..e68ee50 100644
--- a/src/app/views/deployments/_overview.html.haml
+++ b/src/app/views/deployments/_overview.html.haml
@@ -4,7 +4,6 @@
%header.page-header
%h1{:class => controller.controller_name}= t('.pool_name', :pool => @pool.name)
.corner
- = hidden_field :deployment, :name
= hidden_field :deployment, :pool_id
= hidden_field :deployment, :frontend_realm_id
= hidden_field_tag :launch_parameters_encoded, @launch_parameters_encoded
@@ -16,8 +15,12 @@
%p= t('.confirmation', :deployment => @deployment.name, :pool => @pool.name, :quota => number_to_percentage(@additional_quota, :precision => 0))
.content
- %h3= t '.description'
- %p= @deployment.deployable_xml.description
+ %h3= t('.name')
+ %p= text_field :deployment, :name
+
+ - unless @deployment.deployable_xml.description.blank?
+ %h3= t '.description'
+ %p= @deployment.deployable_xml.description
%h3= t('.deployable_xml')
=link_to @deployable.xml_filename, catalog_deployable_path((a)deployable.catalogs.first, @deployable.catalog_entries.first.id, :deployable_xml => true)
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 3e14332..4dab401 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -176,6 +176,7 @@ en:
Are you sure you wish to deploy "%{deployment}" to the %{pool} Pool? Doing
so will utilize %{quota} of your overall deployment quota.
deployable_xml: Deployable XML
+ name: Name
description: Description
image_ids: Image IDs
launch: Launch
--
1.7.6.4
12 years, 6 months