Skip to content

Commit

Permalink
Fix/improve name for tasks that do CUD Tower project/credential
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswnl committed Apr 6, 2017
1 parent 3a7080a commit c82a085
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create_in_provider(manager_id, params)

def create_in_provider_queue(manager_id, params)
manager = ExtManagementSystem.find(manager_id)
action = "Creating #{name} with name=#{params[:name]}"
action = "Creating #{name} with name=#{params[:name] || params['name']}"
queue(manager.my_zone, nil, "create_in_provider", [manager_id, params], action)
end

Expand Down Expand Up @@ -56,7 +56,7 @@ def update_in_provider(params)
end

def update_in_provider_queue(params)
action = "Updating #{self.class.name} with manager_ref=#{manager_ref}"
action = "Updating #{self.class.name} with Tower internal reference=#{manager_ref}"
self.class.send('queue', manager.my_zone, id, "update_in_provider", [params], action)
end

Expand All @@ -66,7 +66,7 @@ def delete_in_provider
end

def delete_in_provider_queue
action = "Deleting #{self.class.name} with manager_ref=#{manager_ref}"
action = "Deleting #{self.class.name} with Tower internal reference=#{manager_ref}"
self.class.send('queue', manager.my_zone, id, "delete_in_provider", [], action)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def store_new_project(project, manager)

it "#delete_in_provider_queue" do
task_id = project.delete_in_provider_queue
expect(MiqTask.find(task_id)).to have_attributes(:name => "Deleting #{described_class.name} with manager_ref=#{project.manager_ref}")
expect(MiqTask.find(task_id)).to have_attributes(:name => "Deleting #{described_class.name} with Tower internal reference=#{project.manager_ref}")
expect(MiqQueue.first).to have_attributes(
:instance_id => project.id,
:args => [],
Expand All @@ -105,7 +105,7 @@ def store_new_project(project, manager)

it "#update_in_provider_queue" do
task_id = project.update_in_provider_queue({})
expect(MiqTask.find(task_id)).to have_attributes(:name => "Updating #{described_class.name} with manager_ref=#{project.manager_ref}")
expect(MiqTask.find(task_id)).to have_attributes(:name => "Updating #{described_class.name} with Tower internal reference=#{project.manager_ref}")
expect(MiqQueue.first).to have_attributes(
:instance_id => project.id,
:args => [{:task_id => task_id}],
Expand Down
4 changes: 2 additions & 2 deletions spec/support/ansible_shared/automation_manager/credential.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def store_new_credential(credential, manager)

it "#delete_in_provider_queue" do
task_id = ansible_cred.delete_in_provider_queue
expect(MiqTask.find(task_id)).to have_attributes(:name => "Deleting #{described_class.name} with manager_ref=#{ansible_cred.manager_ref}")
expect(MiqTask.find(task_id)).to have_attributes(:name => "Deleting #{described_class.name} with Tower internal reference=#{ansible_cred.manager_ref}")
expect(MiqQueue.first).to have_attributes(
:instance_id => ansible_cred.id,
:args => [],
Expand Down Expand Up @@ -116,7 +116,7 @@ def store_new_credential(credential, manager)

it "#update_in_provider_queue" do
task_id = ansible_cred.update_in_provider_queue({})
expect(MiqTask.find(task_id)).to have_attributes(:name => "Updating #{described_class.name} with manager_ref=#{ansible_cred.manager_ref}")
expect(MiqTask.find(task_id)).to have_attributes(:name => "Updating #{described_class.name} with Tower internal reference=#{ansible_cred.manager_ref}")
expect(MiqQueue.first).to have_attributes(
:instance_id => ansible_cred.id,
:args => [{:task_id => task_id}],
Expand Down

0 comments on commit c82a085

Please sign in to comment.