Skip to content

Commit

Permalink
Merge pull request #138 from lfu/ansible_cred_ref_1640533
Browse files Browse the repository at this point in the history
Credential.manager_ref need to be an integer for Tower 3.3

(cherry picked from commit 9e3e1ad)

https://bugzilla.redhat.com/show_bug.cgi?id=1640533
  • Loading branch information
gmcculloug authored and simaishi committed Nov 2, 2018
1 parent a453256 commit 5789c03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -7,7 +7,7 @@ module ClassMethods
def provider_params(params)
if params.keys.include?(:authentication_id)
authentication_id = params.delete(:authentication_id)
params[:credential] = authentication_id ? Authentication.find(authentication_id).manager_ref : nil
params[:credential] = authentication_id ? Authentication.find(authentication_id).native_ref : nil
end
params
end
Expand Down
Expand Up @@ -88,7 +88,7 @@
expect(described_class).to receive(:refresh_in_provider).with(project, nil).and_return(true)
expect(EmsRefresh).to receive(:queue_refresh_task).with(manager).and_return([finished_task])
expect(ExtManagementSystem).to receive(:find).with(manager.id).and_return(manager)
expected_params = params.clone.merge(:credential => '1')
expected_params = params.clone.merge(:credential => 1)
expected_params.delete(:authentication_id)
expect(projects).to receive(:create!).with(expected_params)
allow(Notification).to receive(:create)
Expand Down Expand Up @@ -230,7 +230,7 @@ def expected_notify_action(action)
expect(AnsibleTowerClient::Connection).to receive(:new).and_return(atc)
expect(EmsRefresh).to receive(:queue_refresh_task).with(manager).and_return([finished_task])
expect(described_class).to receive(:refresh_in_provider).with(tower_project, project.id).and_return(true)
expect(tower_project).to receive(:update_attributes!).with(:credential => tower_cred.manager_ref)
expect(tower_project).to receive(:update_attributes!).with(:credential => tower_cred.native_ref)
allow(Notification).to receive(:create)
expect(project.update_in_provider(:authentication_id => tower_cred.id)).to be_a(described_class)
expect(Notification).to have_received(:create).with(expected_notify_update)
Expand Down

0 comments on commit 5789c03

Please sign in to comment.