Skip to content

Commit

Permalink
Fixed ansible model source test
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Abarca committed Jun 27, 2024
1 parent 70945c6 commit 482c807
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ public String getNodesFromInventory(AnsibleRunner.AnsibleRunnerBuilder runnerBui
ansibleInventoryListBuilder.vaultPrompt(vaultPrompt);
}

if (!runner.getLimits().isEmpty()) {
if (runner.getLimits() != null) {
ansibleInventoryListBuilder.limits(runner.getLimits());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.rundeck.plugins.ansible.plugin

import com.dtolabs.rundeck.core.storage.StorageTree
import com.dtolabs.rundeck.core.storage.keys.KeyStorageTree
import org.rundeck.app.spi.Services

import static com.rundeck.plugins.ansible.ansible.AnsibleInventoryList.AnsibleInventoryListBuilder

import com.dtolabs.rundeck.core.common.Framework
Expand Down Expand Up @@ -35,6 +39,10 @@ class AnsibleResourceModelSourceSpec extends Specification {
config.put('project', 'project_1')
config.put(AnsibleDescribable.ANSIBLE_GATHER_FACTS, 'false')
plugin.configure(config)
Services services = Mock(Services) {
getService(KeyStorageTree.class) >> Mock(KeyStorageTree)
}
plugin.setServices(services)

when:
Map<String, String> nodeData = [:]
Expand Down

0 comments on commit 482c807

Please sign in to comment.