[PATCH] BZ#746649 User status readio buttons for edit user are now aligned properly
by Chris Alfonso
---
src/app/stylesheets/layout.scss | 10 ++++++++++
src/app/views/users/_form.html.haml | 13 +++++++------
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/src/app/stylesheets/layout.scss b/src/app/stylesheets/layout.scss
index 60c59e8..3115a5e 100644
--- a/src/app/stylesheets/layout.scss
+++ b/src/app/stylesheets/layout.scss
@@ -2599,6 +2599,16 @@ body.administer form.generic{
p.radio-group label{
display: inline;
}
+ ul.radio-group input{
+ display: inline;
+ margin-left: 1em;
+ margin-top: 0.7em;
+ }
+ ul.radio-group li{
+ display: block;
+ list-style-type: none;
+ overflow: hidden;
+ }
}
fieldset.inline p{
diff --git a/src/app/views/users/_form.html.haml b/src/app/views/users/_form.html.haml
index c2d737e..db98192 100644
--- a/src/app/views/users/_form.html.haml
+++ b/src/app/views/users/_form.html.haml
@@ -40,12 +40,13 @@
-if check_privilege(Privilege::MODIFY, User)
%fieldset
%legend User Status
- %p.radio-group
- = radio_button_tag "user_status","Active",true
- = label_tag "user_status_active", "Active"
- = radio_button_tag "user_status","Inactive", false, :disabled => true
- = label_tag "user_status_inactive", "Inactive"
-
+ %ul.radio-group
+ %li
+ = label_tag "user_status_active", "Active"
+ = radio_button_tag "user_status","Active",true
+ %li
+ = label_tag "user_status_inactive", "Inactive"
+ = radio_button_tag "user_status","Inactive", false, :disabled => true
%fieldset.options
= form.submit "Save User", :class => "submit button pill"
--
1.7.6.4
12 years, 6 months
[PATCH conductor] BZ 746032 - fixed error message when launching a deployment and provider is disabled
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
---
src/app/models/deployment.rb | 1 +
src/app/models/instance.rb | 12 ++++--------
src/app/models/pool.rb | 4 ----
src/app/models/pool_family.rb | 4 ++--
src/app/models/provider_account.rb | 4 ----
src/spec/models/instance_spec.rb | 14 ++++++++++++--
6 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
index 294df0f..91d5e96 100644
--- a/src/app/models/deployment.rb
+++ b/src/app/models/deployment.rb
@@ -94,6 +94,7 @@ class Deployment < ActiveRecord::Base
def pool_must_be_enabled
errors.add(:pool, "must be enabled") unless pool and pool.enabled?
+ errors.add(:pool, "has all associated providers disabled") if pool and pool.pool_family.all_providers_disabled?
end
def object_list
diff --git a/src/app/models/instance.rb b/src/app/models/instance.rb
index 4b282e9..ae20e8e 100644
--- a/src/app/models/instance.rb
+++ b/src/app/models/instance.rb
@@ -163,16 +163,12 @@ class Instance < ActiveRecord::Base
return_val
end
- def enabled?
- pool and pool.enabled? and (provider_account.nil? or provider_account.enabled?)
- end
-
def pool_and_account_enabled_validation
- return if enabled?
+ errors.add(:pool, "must be enabled") unless pool and pool.enabled?
+ errors.add(:pool, "has all associated providers disabled") if pool and pool.pool_family.all_providers_disabled?
- errors.add(:pool, 'must be enabled') unless pool and pool.enabled?
- unless provider_account.nil? or provider_account.enabled?
- errors.add(:provider_account, 'must be enabled')
+ if provider_account and not provider_account.provider.enabled?
+ errors.add(:provider_account, 'provider must be enabled')
end
end
diff --git a/src/app/models/pool.rb b/src/app/models/pool.rb
index 5136e78..ae4e8ce 100644
--- a/src/app/models/pool.rb
+++ b/src/app/models/pool.rb
@@ -77,10 +77,6 @@ class Pool < ActiveRecord::Base
instances.all? {|i| i.destroyable? }
end
- def enabled?
- self.enabled and pool_family and pool_family.enabled?
- end
-
# TODO: Implement Alerts and Updates
def statistics
# TODO - Need to set up cache invalidation before this is safe
diff --git a/src/app/models/pool_family.rb b/src/app/models/pool_family.rb
index 26d5efb..4cad050 100644
--- a/src/app/models/pool_family.rb
+++ b/src/app/models/pool_family.rb
@@ -65,7 +65,7 @@ class PoolFamily < ActiveRecord::Base
self != PoolFamily.default
end
- def enabled?
- provider_accounts.blank? or provider_accounts.any? {|acc| acc.enabled?}
+ def all_providers_disabled?
+ !provider_accounts.empty? and !provider_accounts.any? {|acc| acc.provider.enabled?}
end
end
diff --git a/src/app/models/provider_account.rb b/src/app/models/provider_account.rb
index 38083c2..4e3242e 100644
--- a/src/app/models/provider_account.rb
+++ b/src/app/models/provider_account.rb
@@ -125,10 +125,6 @@ class ProviderAccount < ActiveRecord::Base
instances.empty? || instances.all? { |i| i.destroyable? }
end
- def enabled?
- provider and provider.enabled?
- end
-
def connect
begin
opts = {:username => credentials_hash['username'],
diff --git a/src/spec/models/instance_spec.rb b/src/spec/models/instance_spec.rb
index 4ffdae0..1e7c3b4 100644
--- a/src/spec/models/instance_spec.rb
+++ b/src/spec/models/instance_spec.rb
@@ -232,14 +232,24 @@ describe Instance do
it "should not be launchable if its provider is disabled" do
instance = FactoryGirl.build(:instance_with_disabled_provider)
- instance.should_not be_enabled
instance.should_not be_valid
+ instance.errors[:provider_account].should_not be_empty
+ instance.errors[:provider_account].first.should == "provider must be enabled"
end
it "should not be launchable if its pool is disabled" do
instance = FactoryGirl.build(:instance_in_disabled_pool)
- instance.should_not be_enabled
instance.should_not be_valid
+ instance.errors[:pool].should_not be_empty
+ instance.errors[:pool].first.should == "must be enabled"
+ end
+
+ it "should not be launchable if its pool's providers are all disabled" do
+ instance = FactoryGirl.build(:instance)
+ instance.pool.pool_family.provider_accounts << FactoryGirl.create(:disabled_provider_account)
+ instance.should_not be_valid
+ instance.errors[:pool].should_not be_empty
+ instance.errors[:pool].first.should == "has all associated providers disabled"
end
context "When more instances of deployment are starting" do
--
1.7.6
12 years, 6 months
[PATCH 0/6] Improve and unify tables according to new design
by Jirka Tomasek
This patchset implements Redmine 2486, Flat tables through the application
are styled according to admin UI design guidelines.
The checkbox column has class 'checkbox', alert icons column
has class 'alert', Columns with numerical values have class 'center'
This patchset doesnt solve the table header buttons position.
12 years, 6 months
[PATCH 0/2 aeolus-image-rubygem] #2462 - OAuth-capable Factory client
by Matt Wagner
Hi all,
This patch adds support for OAuth to our Image Factory client which uses Active Resource. I also added some basic tests.
A few things I'd like to call attention to:
- My goal was to monkey-patch Active Resource to add OAuth support[1]. Doing so meant that I had to duplicate a handful of lines of code from Active Resource into our project. It would be fantastic if someone more familiar with the ASL (used for aeolus-image-rubygem) and the MIT license (under which Active Resource is released) could confirm that this is kosher before I commit this code. We could also just license this module under the MIT license if that would avoid a licensing headache.
- This patch adds vcr, webmock, and timecop dependencies, as I mocked out our requests to Image Factory. I updated the RPM spec to this effect. (All three dependencies are already required by aeolus-conductor-devel.) Does it make sense to consider a -devel version of aeolus-image-rubygem as well so that these dependencies aren't pushed mainstream? (Or else, shall I add them to %check in the RPM spec?) I incremented the version in the RPM spec.
Best,
Matt
[1] I highly doubt that a patch adding OAuth support to Active Resource would be accepted upstream, as it would introduce a dependency on the oauth gem to a core component of Rails.
12 years, 6 months
updating aeolus in F16
by Mo Morsi
Chris and I went over what we'd need to do to get 0.4.0 into F16 this
morning. If we parallelize the task according to the packagers list I
sent out last week, the problem should be significantly reduced.
If everyone cc'd on this email could look at their respective packages
below and update them in Fedora in the next day or two, it would be much
appreciated. Please do this sooner than later as we will need this to be
done for the Fedora / cloud testing day next week (and well in advance
to give me the chance to finish up writing the test instructions)
Please update the rpms in Fedora from the ones found here (as well as
any dependencies you need)
http://repos.fedorapeople.org/repos/aeolus/conductor/0.4.0/fedora-15/
Also please set the update karma to '1' so we can just vote / push them
to stable immediately when the update is submitted.
sseago: conductor
jmeyering: iwhd
myself: configure,
mfojtik: deltacloud
sloranz: imagefactory, aeolus-image (if you are not able to get push
rights in the next day or two, I will take these over myself)
I realize this is an interruption from the normal scheduled workflow and
noone likes packaging but if we hunker down we can get this out of the
way quickly and move onto better things (and the latest / greatest
aeolus will be in Fedora!)
Appreciate it,
-Mo
12 years, 6 months
[PATCH aeolus-conductor 1/3] Removed type and href from collections
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
src/app/views/api/builds/index.xml.haml | 2 +-
src/app/views/api/images/index.xml.haml | 2 +-
src/app/views/api/provider_images/_image.xml.haml | 1 -
src/app/views/api/provider_images/index.xml.haml | 2 +-
src/app/views/api/target_images/_image.xml.haml | 1 -
src/app/views/api/target_images/index.xml.haml | 2 +-
6 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/app/views/api/builds/index.xml.haml b/src/app/views/api/builds/index.xml.haml
index aca031c..56b5444 100644
--- a/src/app/views/api/builds/index.xml.haml
+++ b/src/app/views/api/builds/index.xml.haml
@@ -1,4 +1,4 @@
!!! XML
-%builds{:type => 'xs:list'}
+%builds
- @builds.each do |bld|
= render :partial => 'build', :locals => {:build => bld}
diff --git a/src/app/views/api/images/index.xml.haml b/src/app/views/api/images/index.xml.haml
index 62262ec..02933d8 100644
--- a/src/app/views/api/images/index.xml.haml
+++ b/src/app/views/api/images/index.xml.haml
@@ -1,4 +1,4 @@
!!!XML
-%images{:type => 'xs:list', :href => api_images_url}
+%images
- @images.each do |img|
= render :partial => 'image', :locals => {:image => img}
diff --git a/src/app/views/api/provider_images/_image.xml.haml b/src/app/views/api/provider_images/_image.xml.haml
index 788fabd..54dd9fa 100644
--- a/src/app/views/api/provider_images/_image.xml.haml
+++ b/src/app/views/api/provider_images/_image.xml.haml
@@ -3,7 +3,6 @@
- if @image.respond_to?('status')
%status=(a)image.status
- else
- %icicle= image.icicle
%object_type= image.object_type
%target_identifier= image.target_identifier
%status="COMPLETE"
diff --git a/src/app/views/api/provider_images/index.xml.haml b/src/app/views/api/provider_images/index.xml.haml
index fd7d01e..f6960bd 100644
--- a/src/app/views/api/provider_images/index.xml.haml
+++ b/src/app/views/api/provider_images/index.xml.haml
@@ -1,4 +1,4 @@
!!!XML
-%provider_images{:type => 'xs:list', :href=>api_provider_images_url}
+%provider_images
- @images.each do |img|
= render :partial => 'image', :locals => {:image => img}
diff --git a/src/app/views/api/target_images/_image.xml.haml b/src/app/views/api/target_images/_image.xml.haml
index 499b329..a112a24 100644
--- a/src/app/views/api/target_images/_image.xml.haml
+++ b/src/app/views/api/target_images/_image.xml.haml
@@ -3,7 +3,6 @@
- if @image.respond_to?('status')
%status=(a)image.status
- else
- %icicle= image.icicle
%object_type= image.object_type
%template= image.template
%build{:href=>api_build_url(image.build.id), :id=>image.build.id}
diff --git a/src/app/views/api/target_images/index.xml.haml b/src/app/views/api/target_images/index.xml.haml
index 995f613..aad4ec2 100644
--- a/src/app/views/api/target_images/index.xml.haml
+++ b/src/app/views/api/target_images/index.xml.haml
@@ -1,4 +1,4 @@
!!!XML
-%target_images{:type => 'xs:list', :href=>api_target_images_url}
+%target_images
- @images.each do |img|
= render :partial => 'image', :locals => {:image => img}
--
1.7.6.2
12 years, 6 months
[PATCH] BZ#744764 No Data displayed in Active Inst. and Available Inst. column
by Chris Alfonso
I've added pool data for the two columns.
---
src/app/models/pool.rb | 29 ++++++++++++++------------
src/app/views/pool_families/index.html.haml | 4 +-
2 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/src/app/models/pool.rb b/src/app/models/pool.rb
index a6b4e2c..5136e78 100644
--- a/src/app/models/pool.rb
+++ b/src/app/models/pool.rb
@@ -85,19 +85,22 @@ class Pool < ActiveRecord::Base
def statistics
# TODO - Need to set up cache invalidation before this is safe
#Rails.cache.fetch("pool-#{id}-statistics") do
- {
- :cloud_providers => instances.collect{|i| i.provider_account}.uniq.count,
- :deployments => deployments.count,
- :total_instances => (instances.deployed.count +
- instances.pending.count + instances.failed.count),
- :instances_deployed => instances.deployed.count,
- :instances_pending => instances.pending.count,
- :instances_failed => instances.failed.count,
- :used_quota => quota.running_instances,
- :quota_percent => number_to_percentage(quota.percentage_used,
- :precision => 0),
- :available_quota => quota.maximum_running_instances
- }
+ max = quota.maximum_running_instances
+ total = quota.running_instances
+ avail = max - total unless max.nil?
+ statistics = {
+ :cloud_providers => instances.collect{|i| i.provider_account}.uniq.count,
+ :deployments => deployments.count,
+ :total_instances => (instances.deployed.count +
+ instances.pending.count + instances.failed.count),
+ :instances_deployed => instances.deployed.count,
+ :instances_pending => instances.pending.count,
+ :instances_failed => instances.failed.count,
+ :used_quota => quota.running_instances,
+ :quota_percent => number_to_percentage(quota.percentage_used,
+ :precision => 0),
+ :available_quota => avail
+ }
#end
end
diff --git a/src/app/views/pool_families/index.html.haml b/src/app/views/pool_families/index.html.haml
index b370cb8..3cc1061 100644
--- a/src/app/views/pool_families/index.html.haml
+++ b/src/app/views/pool_families/index.html.haml
@@ -39,7 +39,7 @@
%td= pool.statistics[:instances_pending]
%td= pool.statistics[:instances_failed]
%td= pool.statistics[:quota_percent]
- %td
- %td
+ %td= pool.statistics[:used_quota]
+ %td= pool.statistics[:available_quota].nil? ? raw('∞') : pool.statistics[:available_quota]
%td= link_to pool.catalogs.first.name, catalog_path(pool.catalogs.first) if pool.catalogs.any?
%td= link_to 'Edit', edit_pool_path(pool), :class => 'rounded-link'
--
1.7.6.2
12 years, 6 months