[PATCH conductor 4/7] Renames credentials in XML for Provider Account

pblaho at redhat.com pblaho at redhat.com
Wed Aug 15 17:11:27 UTC 2012


From: Petr Blaho <pblaho at redhat.com>

This renames credentials node in XML for Provider Account
to be in align with data for create and update actions

Now in XML there will be used name field of CredentialDefinition
not label
---
 .../views/provider_accounts/_credentials.xml.haml  |    4 ++--
 src/app/views/provider_accounts/_detail.xml.haml   |    4 ++--
 .../step_definitions/provider_account_steps.rb     |    4 ++--
 .../shared_examples_for_provider_accounts_api.rb   |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/app/views/provider_accounts/_credentials.xml.haml b/src/app/views/provider_accounts/_credentials.xml.haml
index 1d40187..3b67070 100644
--- a/src/app/views/provider_accounts/_credentials.xml.haml
+++ b/src/app/views/provider_accounts/_credentials.xml.haml
@@ -1,2 +1,2 @@
--creds_label_hash.each do |h|
-  =content_tag(h[:label], h[:value])
+-creds_hash.each do |node, value|
+  =content_tag(node, value)
diff --git a/src/app/views/provider_accounts/_detail.xml.haml b/src/app/views/provider_accounts/_detail.xml.haml
index 67b7df0..93fbfc7 100644
--- a/src/app/views/provider_accounts/_detail.xml.haml
+++ b/src/app/views/provider_accounts/_detail.xml.haml
@@ -5,8 +5,8 @@
   %provider{:id => provider.id, :href => api_provider_url(provider)}= provider.name
   %provider_type= provider_type.deltacloud_driver
   -if local_assigns[:with_credentials]
-    = content_tag(provider_type.deltacloud_driver + '_credentials') do
-      = render 'credentials', :creds_label_hash => provider_account.creds_label_hash
+    = content_tag('credentials') do
+      = render 'credentials', :creds_hash => provider_account.credentials_hash
   -if provider_account.priority
     %priority= provider_account.priority
   -if local_assigns[:with_quota]
diff --git a/src/features/step_definitions/provider_account_steps.rb b/src/features/step_definitions/provider_account_steps.rb
index ffec799..d758395 100644
--- a/src/features/step_definitions/provider_account_steps.rb
+++ b/src/features/step_definitions/provider_account_steps.rb
@@ -99,7 +99,7 @@ end
 
 Then /^there should be these mock provider accounts:$/ do |table|
   accounts = @xml_response.root.xpath('/provider_accounts/provider_account').map do |n|
-    {:name => n.xpath('name').text,
+    {:name => n.xpath('label').text,
      :provider  => n.xpath('provider').text,
      :username => n.xpath('username').text,
      :password => n.xpath('password').text,
@@ -117,7 +117,7 @@ end
 
 Then /^there should be these ec2 provider accounts:$/ do |table|
   accounts = @xml_response.root.xpath('/provider_accounts/provider_account').map do |n|
-    {:name => n.xpath('name').text,
+    {:name => n.xpath('label').text,
      :provider  => n.xpath('provider').text,
      :access_key => n.xpath('access_key').text,
      :secret_access_key => n.xpath('secret_access_key').text,
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 3d37616..3443e16 100644
--- a/src/spec/support/shared_examples_for_provider_accounts_api.rb
+++ b/src/spec/support/shared_examples_for_provider_accounts_api.rb
@@ -26,7 +26,7 @@ end
 shared_examples_for "having correct set of credentials" do
   it "should be correct" do
     provider_account.credentials.each do |credential|
-      label = credential.credential_definition.label
+      label = credential.credential_definition.name
       value = credential.value
       xml_provider_account.xpath('//' + label).text.should be_eql(value)
     end
-- 
1.7.7.6




More information about the aeolus-devel mailing list