[PATCH aeolus-conductor 1/2] BZ:864192 Change Provider Account List default behaviour to return full detail
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
.../controllers/provider_accounts_controller.rb | 2 +-
src/app/views/provider_accounts/_detail.xml.haml | 2 +-
src/app/views/provider_accounts/_list.xml.haml | 2 +-
.../shared_examples_for_provider_accounts_api.rb | 8 ++++++--
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/app/controllers/provider_accounts_controller.rb b/src/app/controllers/provider_accounts_controller.rb
index a4c6ba9..bc5bc7d 100644
--- a/src/app/controllers/provider_accounts_controller.rb
+++ b/src/app/controllers/provider_accounts_controller.rb
@@ -28,7 +28,7 @@ class ProviderAccountsController < ApplicationController
#xml list of provider_accounts for aeolus-image, aeolus-image could work with prov. accounts list for givent provider
#to resemble html views logic, so this route could be removed (provider_accounts could be user only as nested resource)
#format.xml { render :text => ProviderAccount.xml_export(@provider_accounts) }
- format.xml { render :partial => 'list.xml', :locals => { :provider_accounts => @provider_accounts, :with_credentials => false, :with_quota => false, :with_data => false } }
+ format.xml { render :partial => 'list.xml', :locals => { :provider_accounts => @provider_accounts, :with_credentials => false, :with_quota => false, :minimal => false } }
end
end
diff --git a/src/app/views/provider_accounts/_detail.xml.haml b/src/app/views/provider_accounts/_detail.xml.haml
index e8b7617..9b2688d 100644
--- a/src/app/views/provider_accounts/_detail.xml.haml
+++ b/src/app/views/provider_accounts/_detail.xml.haml
@@ -1,5 +1,5 @@
%provider_account{:id => provider_account.id, :href => api_provider_account_url(provider_account)}
- -if local_assigns[:with_data]
+ -unless local_assigns[:minimal]
-provider = provider_account.provider
-provider_type = provider.provider_type
%label= provider_account.name
diff --git a/src/app/views/provider_accounts/_list.xml.haml b/src/app/views/provider_accounts/_list.xml.haml
index 8323435..cf28087 100644
--- a/src/app/views/provider_accounts/_list.xml.haml
+++ b/src/app/views/provider_accounts/_list.xml.haml
@@ -1,4 +1,4 @@
!!! XML
%provider_accounts
- provider_accounts.each do |provider_account|
- =render 'detail', :provider_account => provider_account, :with_credentials => with_credentials, :with_quota => with_quota, :with_data => with_data
+ =render 'detail', :provider_account => provider_account, :with_credentials => with_credentials, :with_quota => with_quota, :minimal => minimal
diff --git a/src/spec/support/shared_examples_for_provider_accounts_api.rb b/src/spec/support/shared_examples_for_provider_accounts_api.rb
index b3d3157..9fbc9e6 100644
--- a/src/spec/support/shared_examples_for_provider_accounts_api.rb
+++ b/src/spec/support/shared_examples_for_provider_accounts_api.rb
@@ -12,8 +12,12 @@ shared_examples_for "having XML with provider accounts" do
xml_provider_account = xml_provider_accounts.xpath("//provider_account[@id=\"#{provider_account.id}\"]")
xml_provider_account.xpath('@href').text.should be_eql(api_provider_account_url(provider_account))
# xml_provider_account.xpath('label').text.should be_eql(provider_account.name.to_s)
- # it should not have provider accounts details
- %w{label provider provider_type quota_used quota priority credentials}.each do |element|
+
+ %w{label provider provider_type}.each do |element|
+ xml_provider_account.xpath(element).should_not be_empty
+ end
+
+ %w{quota_used quota priority credentials}.each do |element|
xml_provider_account.xpath(element).should be_empty
end
end
--
1.7.6.4
11 years, 6 months
[PATCH aeolus-conductor] BZ:864190 Change Provider List default behaviour to show provider data
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
Since we do not want to break API behaviour from v1.0. Here I have set the default
API behaviour to return the full provider data. Users can now pass in an option
minimal paramter to retreived only the provider href and id in the provider collections
---
src/app/controllers/providers_controller.rb | 2 +-
src/app/views/providers/_list.xml.haml | 2 +-
src/spec/controllers/providers_controller_spec.rb | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/app/controllers/providers_controller.rb b/src/app/controllers/providers_controller.rb
index b475dee..dfd577c 100644
--- a/src/app/controllers/providers_controller.rb
+++ b/src/app/controllers/providers_controller.rb
@@ -40,7 +40,7 @@ class ProvidersController < ApplicationController
respond_to do |format|
format.html
format.js { render :partial => 'list' }
- format.xml { render :partial => 'list.xml' , :locals => { :with_data => params[:with_data] }}
+ format.xml { render :partial => 'list.xml' , :locals => { :minimal => params[:minimal] }}
end
end
diff --git a/src/app/views/providers/_list.xml.haml b/src/app/views/providers/_list.xml.haml
index 72e20da..7cd0bdb 100644
--- a/src/app/views/providers/_list.xml.haml
+++ b/src/app/views/providers/_list.xml.haml
@@ -2,7 +2,7 @@
%providers
- @providers.each do |p|
%provider{:id => p.id, :href => api_provider_url(p)}
- -if local_assigns[:with_data]
+ -unless local_assigns[:minimal]
%name= p.name
%url= p.url
%provider_type= p.provider_type.deltacloud_driver
diff --git a/src/spec/controllers/providers_controller_spec.rb b/src/spec/controllers/providers_controller_spec.rb
index 2249ee7..ad9a284 100644
--- a/src/spec/controllers/providers_controller_spec.rb
+++ b/src/spec/controllers/providers_controller_spec.rb
@@ -36,7 +36,7 @@ describe ProvidersController do
# xml_provider.xpath('name').text.should be_eql(provider.name.to_s)
# it should not have details of providers
%w{name url provider_type deltacloud_provider}.each do |element|
- xml_provider.xpath(element).should be_empty
+ xml_provider.xpath(element).should_not be_empty
end
end
end
--
1.7.6.4
11 years, 6 months
End of Sprint commits tagged and bagged
by steve linabery
Hi aeolus development community!
First of all, another pat on the back for all the cool stuff we got done during the past sprint.
I have tagged commits with the unimaginative tag, '2012.9.Sprint1', to represent the end-of-sprint results.
Github has kindly created tarballs for posterity's benefit, e.g. [1]. You can find similar zip/tarballs for the other components by clicking on the 'Tags' tab on each project's main github page.
Keep it coming!
Steve|eggs
[1] https://github.com/aeolusproject/conductor/tarball/2012.9.Sprint1
11 years, 6 months
olf summary
by Mo Morsi
How the weekend flew by (and the time prepping for it!). In no
particular order
* Overall great conference, Aeolus demos went perfectly (was cool to
show our tool being used to address some of the problems w/ the cloud
other presenters were talking about), promoted the project extensively
(handing out stickers), and got interesting perspectives
* Perhaps the most notable is that openstack isn't the clear victor in
the cloud wars, there were fans / users of many different
implementations including oVirt. The cloud is so new, and any
implementation specific to one way of doing things, so there is alot of
uncertainty. I feel Aeolus fits perfectly into resolving this
* Citrix sponsored the Build Your Own Cloud day, and said they'd love to
work w/ us to build support for their cloudstack api in our tools. They
are also having a conference in Vegas this november and invite any
contributors / users of our project to attend and/or present.
* The puppet team seemed to be a fan of vagrant / leveraging this more
for the puppet infra: http://vagrantup.com/ (they are going to be
expanding it beyond virtualbox)
* Brought my desktop to act as an external cloud resource (from the
perspective of aeolus on my laptop) during the presentations, but
should've brought a small travel-dolly to carry it with! (nbd, was able
to stash it away in the secure operations room)
* Found out about a relatively new postgres feature that is gaining some
popularity, dblink the ability to link local tables to data in external
databases:
http://www.postgresonline.com/journal/archives/44-Using-DbLink-to-access-...
* I pointed people to our community resources, and told people that they
could just shout out via the list or irc if there were any questions or
any way we could help them out to use the software. Be sure to be on the
lookout for those and please help out if you can.
There were a couple of other things, will make sure to pass along
anything notable to the relevant parties. Will also share the video of
my talk when it becomes available.
-Mo
11 years, 6 months
new templates for the repo
by Mo Morsi
After a bit of wrestling w/ the latest imagefactory HEAD (thx to imcleod
for all the assistance resolving issues), I have pushed some simple
templates to build / deploy some fedora infrastructure components
including mock, koji, and bodhi to the cloud. You may find them in the
aeolus templates repo [1]
I plan on writing up a blog post in the next few days (hopefully with a
screencast as part of that) on using these templates, imagefactory, and
deltacloud (and possibly audrey) to bring up Fedora infrastructure on
the cloud (EC2, openstack, and oVirt)
-Mo
[1] https://github.com/aeolus-incubator/templates/tree/master/fedora_infra
11 years, 6 months