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

New Tower credential types #9

Merged
merged 12 commits into from
Jul 12, 2017
Merged

New Tower credential types #9

merged 12 commits into from
Jul 12, 2017

Conversation

jameswnl
Copy link
Contributor

@jameswnl jameswnl commented Jun 27, 2017

Make MIQ's support to be on par with what Tower supports.

https://www.pivotaltracker.com/story/show/148234657

Created https://bugzilla.redhat.com/show_bug.cgi?id=1478898 for backporting to fine

@miq-bot miq-bot added the wip label Jun 27, 2017
@bronaghs bronaghs mentioned this pull request Jun 28, 2017
@jameswnl jameswnl changed the title [WIP] New Tower credential types New Tower credential types Jun 29, 2017
@jameswnl
Copy link
Contributor Author

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Jun 29, 2017
@bronaghs bronaghs requested a review from durandom July 3, 2017 14:13
@bronaghs
Copy link

bronaghs commented Jul 3, 2017

hey @durandom - Can you please review this? Danke!

Copy link
Member

@durandom durandom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
some question, but minor

@@ -0,0 +1,49 @@
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::OpenstackCredential
extend ActiveSupport::Concern
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you are following the pattern in the other credential modules, but why is AS::Concern used here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -80,6 +80,37 @@ class PopulateTower
end

def create_dataset

ssh_key_data = <<~HEREDOC
-----BEGIN RSA PRIVATE KEY-----
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for sharing you private ssh key 😈

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are welcome. generated for this particular purpose only 😄

@@ -100,12 +100,12 @@
def assert_counts
expect(Provider.count).to eq(1)
expect(automation_manager).to have_attributes(:api_version => "3.0.1")
expect(automation_manager.configured_systems.count).to eq(130)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these counts are a pain.
in aws we changed this to get the counts straight from the API and just assert they are equal to objects counts in the DB.

You would access the API easily via automation_manager.provider.connect.hosts.count
Maybe add a safe trap, that the numbers are non-zero

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, was actually considering this. but thinking of using the Faraday direct call to avoid depending on the Ansible Tower Gem. What do you think?
automation_manager.provider.connect.hosts.count would be much more straightforward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@durandom let's keep this as is for now. There's some strange issue with the Tower we have been using to perform this test.

(The reported count of hosts is more than the actual hosts returned)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reported count of hosts is more than the actual hosts returned

🤔

If you have some spare time 😆 maybe you want to add a docker run for setting up a tower and populating it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did and ended up aborting it because it needs enterprise license to support survey spec.

@miq-bot
Copy link
Member

miq-bot commented Jul 11, 2017

Some comments on commits https://github.com/jameswnl/manageiq-providers-ansible_tower/compare/64aaae7bd1c7d1f5ff2019207ded963da351aedf~...80c24cecbf9653bd72e82c6b9b1533547b6dc4ac

spec/vcr_cassettes/manageiq/providers/ansible_tower/automation_manager/refresher.yml

  • 💣 💥 🔥 🚒 - 1768 - Detected cfme

@miq-bot
Copy link
Member

miq-bot commented Jul 11, 2017

Checked commits https://github.com/jameswnl/manageiq-providers-ansible_tower/compare/64aaae7bd1c7d1f5ff2019207ded963da351aedf~...80c24cecbf9653bd72e82c6b9b1533547b6dc4ac with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
18 files checked, 52 offenses detected

app/models/manageiq/providers/ansible_tower/shared/automation_manager/azure_credential.rb

  • ❗ - Line 10, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 22, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 28, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 34, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 3, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 4, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 5, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 8, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 9, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.

app/models/manageiq/providers/ansible_tower/shared/automation_manager/google_credential.rb

  • ❗ - Line 13, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 14, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 15, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 16, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 19, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.

app/models/manageiq/providers/ansible_tower/shared/automation_manager/network_credential.rb

  • ❗ - Line 17, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 18, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 19, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 20, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 23, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 24, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 25, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 27, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 28, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 29, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 30, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 31, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 33, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 34, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 35, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 36, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 37, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 3, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.

app/models/manageiq/providers/ansible_tower/shared/automation_manager/openstack_credential.rb

  • ❗ - Line 17, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 31, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 3, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.

app/models/manageiq/providers/ansible_tower/shared/automation_manager/rackspace_credential.rb

  • ❗ - Line 3, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.

app/models/manageiq/providers/ansible_tower/shared/automation_manager/satellite6_credential.rb

  • ❗ - Line 10, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 11, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 12, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 3, Col 5 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 4, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 5, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 6, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 9, Col 7 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.

lib/tasks_private/spec_helper.rake

  • 💣 💥 🔥 🚒 - Line 101, Col 39 - Syntax - unexpected token tIDENTIFIER
    (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 109, Col 25 - Syntax - unexpected token tCONSTANT
    (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 111, Col 10 - Syntax - unexpected token klEND
    (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 84, Col 20 - Syntax - unexpected token tLSHFT
    (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 85, Col 10 - Syntax - unexpected token klBEGIN
    (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 88, Col 58 - Syntax - unexpected token tCONSTANT
    (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 92, Col 65 - Syntax - unexpected token tIDENTIFIER
    (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 97, Col 6 - Syntax - unexpected token tCONSTANT
    (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)

@blomquisg blomquisg merged commit 530ae10 into ManageIQ:master Jul 12, 2017
@blomquisg blomquisg added this to the Sprint 65 Ending Jul 24, 2017 milestone Jul 12, 2017
@jameswnl
Copy link
Contributor Author

@miq-bot add_labels fine/yes

@jameswnl jameswnl deleted the creds2 branch July 13, 2017 14:03
@simaishi
Copy link
Contributor

simaishi commented Aug 4, 2017

@jameswnl Is there a BZ for this? Can you please create if it doesn't exist?

@simaishi
Copy link
Contributor

Backported to Fine via ManageIQ/manageiq#15780

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants