forked from saltstack/salt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes saltstack#61946 sync_after_install immutabledict error
- Loading branch information
1 parent
e848b9f
commit 048bfd5
Showing
4 changed files
with
90 additions
and
13 deletions.
There are no files selected for viewing
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 @@ | ||
Fix salt-cloud sync_after_install functionality |
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
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
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,38 @@ | ||
import copy | ||
|
||
import pytest | ||
import salt.config | ||
from salt.cloud import Cloud | ||
from tests.support.mock import MagicMock, patch | ||
|
||
|
||
@pytest.fixture | ||
def master_config(): | ||
opts = copy.deepcopy(salt.config.DEFAULT_MASTER_OPTS) | ||
opts["parallel"] = False | ||
opts["providers"] = { | ||
"test": {}, | ||
} | ||
return opts | ||
|
||
|
||
@pytest.fixture | ||
def vm_config(): | ||
return { | ||
"driver": "test", | ||
"name": "test", | ||
"provider": "test:test", | ||
} | ||
|
||
|
||
def test_cloud_create_attempt_sync_after_install(master_config, vm_config): | ||
master_config["sync_after_install"] = "all" | ||
cloud = Cloud(master_config) | ||
cloud.clouds["test.create"] = lambda x: True | ||
|
||
with patch( | ||
"salt.client.get_local_client", | ||
MagicMock(return_value=MagicMock(return_value=True)), | ||
): | ||
ret = cloud.create(vm_config) | ||
assert ret |