Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credential.manager_ref need to be an integer for Tower 3.3 #138

Merged
merged 1 commit into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.id])
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.id])
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