Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rambleraptor committed Aug 21, 2019
1 parent c65530e commit 078fcce
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 2 additions & 0 deletions overrides/ansible/resource_override.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def self.attributes
collection
custom_create_resource
custom_update_resource
custom_tests
create
delete
has_tests
Expand Down Expand Up @@ -70,6 +71,7 @@ def validate
check :collection, type: ::String
check :custom_create_resource, type: :boolean, default: false
check :custom_update_resource, type: :boolean, default: false
check :custom_tests, type: :boolean, default: false
check :create, type: ::String
check :delete, type: ::String
check :has_tests, type: :boolean, default: true
Expand Down
2 changes: 2 additions & 0 deletions products/kms/ansible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ datasources: !ruby/object:Overrides::ResourceOverrides
for inputs.
overrides: !ruby/object:Overrides::ResourceOverrides
KeyRing: !ruby/object:Overrides::Ansible::ResourceOverride
custom_tests: true
transport: !ruby/object:Overrides::Ansible::Transport
decoder: decode_response
provider_helpers:
- products/kms/helpers/python/provider_key_ring.py
delete: |
module.fail_json(msg="KeyRings cannot be deleted")
CryptoKey: !ruby/object:Overrides::Ansible::ResourceOverride
custom_tests: true
transport: !ruby/object:Overrides::Ansible::Transport
decoder: decode_response
provider_helpers:
Expand Down
5 changes: 2 additions & 3 deletions products/kms/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ objects:
- !ruby/object:Api::Type::String
name: 'keyRing'
description: |
The KeyRing that this key belongs to. Format: `'projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}'`.
of the format
'projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}'
The KeyRing that this key belongs to.
Format: `'projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}'`.
required: true
input: true
url_param_only: true
Expand Down
12 changes: 7 additions & 5 deletions provider/ansible.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,13 @@ def generate_resource_tests(data)
name = module_name(data.object)
path = File.join(target_folder,
"test/integration/targets/#{name}/tasks/main.yml")
data.generate(
'templates/ansible/integration_test.erb',
path,
self
)
unless data.object.custom_tests
data.generate(
'templates/ansible/integration_test.erb',
path,
self
)
end

# Generate 'defaults' file that contains variables.
path = File.join(target_folder,
Expand Down

0 comments on commit 078fcce

Please sign in to comment.