-
Notifications
You must be signed in to change notification settings - Fork 54
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
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
64aaae7
NetworkCredential
jameswnl 9d9f49b
OpenstackCredential
jameswnl 2fd7939
GoogleCredential
jameswnl 6747d39
RackspaceCredential
525e24d
Azure(RM)Credential
6e23557
Satellite(6)Crendential
2b8d9ad
credential fields hint text update
5a863e3
spec tests for credential refresh
jameswnl 4b84564
spec helper rake task add new credential type objects
61523b5
update cassette and corresponding spec
2fc5ff8
remove ActivieSupport:Concern from credentials
80c24ce
Workaround for a test failure caused by https://github.com/ansible/an…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
app/models/manageiq/providers/ansible_tower/automation_manager/openstack_credential.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
class ManageIQ::Providers::AnsibleTower::AutomationManager::OpenstackCredential < ManageIQ::Providers::AnsibleTower::AutomationManager::CloudCredential | ||
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::OpenstackCredential | ||
end |
49 changes: 49 additions & 0 deletions
49
...models/manageiq/providers/ansible_tower/shared/automation_manager/openstack_credential.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::OpenstackCredential | ||
extend ActiveSupport::Concern | ||
|
||
COMMON_ATTRIBUTES = { | ||
:userid => { | ||
:label => N_('Username'), | ||
:help_text => N_('Username for this credential'), | ||
:required => true | ||
}, | ||
:password => { | ||
:type => :password, | ||
:label => N_('Password (API Key)'), | ||
:help_text => N_('Password for this credential'), | ||
:required => true | ||
} | ||
}.freeze | ||
|
||
EXTRA_ATTRIBUTES = { | ||
:host => { | ||
:type => :string, | ||
:label => N_('Host (Authentication URL'), | ||
:help_text => N_('The host to authenticate with. For example, https://openstack.business.com/v2.0'), | ||
:max_length => 1024, | ||
:required => true | ||
}, | ||
:project => { | ||
:type => :string, | ||
:label => N_('Project (Tenant Name)'), | ||
:help_text => N_('This is the tenant name. This value is usually the same as the username'), | ||
:max_length => 100, | ||
:required => true | ||
}, | ||
:domain => { | ||
:type => :string, | ||
:label => N_('Domain Name'), | ||
:help_text => N_('OpenStack domains define administrative boundaries. It is only needed for Keystone v3 authentication URLs'), | ||
:max_length => 100 | ||
} | ||
}.freeze | ||
|
||
API_ATTRIBUTES = COMMON_ATTRIBUTES.merge(EXTRA_ATTRIBUTES).freeze | ||
|
||
API_OPTIONS = { | ||
:type => 'cloud', | ||
:label => N_('OpenStack'), | ||
:attributes => API_ATTRIBUTES | ||
}.freeze | ||
TOWER_KIND = 'openstack'.freeze | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!