Skip to content

Commit

Permalink
Merge pull request #32287 from rallytime/reimplement-31172
Browse files Browse the repository at this point in the history
Reimplement #31172, which got removed in a merge-forward.
  • Loading branch information
Mike Place committed Apr 4, 2016
2 parents f65cb38 + e195376 commit 95bcdaa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions salt/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,7 @@ def cloud_config(path, env_var='SALT_CLOUD_CONFIG', defaults=None,
os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..',
'cloud',
'deploy'
)
Expand Down
19 changes: 19 additions & 0 deletions tests/unit/config/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,25 @@ def test_cloud_config_providers_in_opts_path(self):
self.assertRaises(SaltCloudConfigError, sconfig.cloud_config, PATH,
providers_config_path='bar')

@patch('os.path.isdir', MagicMock(return_value=True))
def test_cloud_config_deploy_scripts_search_path(self):
'''
Tests the contents of the 'deploy_scripts_search_path' tuple to ensure that
the correct deploy search paths are present.
There should be two search paths reported in the tuple: ``/etc/salt/cloud.deploy.d``
and ``<path-to-salt-install>/salt/cloud/deploy``.
'''
search_paths = sconfig.cloud_config('/etc/salt/cloud').get('deploy_scripts_search_path')
etc_deploy_path = '/salt/cloud.deploy.d'
deploy_path = '/salt/cloud/deploy'

# Check cloud.deploy.d path is the first element in the search_paths tuple
self.assertTrue(search_paths[0].endswith(etc_deploy_path))

# Check the second element in the search_paths tuple
self.assertTrue(search_paths[1].endswith(deploy_path))

# apply_cloud_config tests

def test_apply_cloud_config_no_provider_detail_list(self):
Expand Down

0 comments on commit 95bcdaa

Please sign in to comment.