Merge "Deprecate group:os-apply-config with config-download"
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- group:os-apply-config deployments are deprecated for use with
|
||||||
|
config-download and they will not be applied.
|
@@ -15,13 +15,13 @@ import fixtures
|
|||||||
import mock
|
import mock
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
import warnings
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from mock import call
|
from mock import call
|
||||||
from mock import patch
|
from mock import patch
|
||||||
|
|
||||||
from tripleo_common import constants
|
from tripleo_common import constants
|
||||||
from tripleo_common import exception
|
|
||||||
from tripleo_common.tests import base
|
from tripleo_common.tests import base
|
||||||
from tripleo_common.tests.fake_config import fakes
|
from tripleo_common.tests.fake_config import fakes
|
||||||
from tripleo_common.utils import config as ooo_config
|
from tripleo_common.utils import config as ooo_config
|
||||||
@@ -345,5 +345,8 @@ class TestConfig(base.TestCase):
|
|||||||
mock_config_dict.side_effect = self._get_config_dict
|
mock_config_dict.side_effect = self._get_config_dict
|
||||||
|
|
||||||
self.tmp_dir = self.useFixture(fixtures.TempDir()).path
|
self.tmp_dir = self.useFixture(fixtures.TempDir()).path
|
||||||
self.assertRaises(exception.GroupOsApplyConfigException,
|
with warnings.catch_warnings(record=True) as w:
|
||||||
self.config.download_config, stack, self.tmp_dir)
|
self.config.download_config(stack, self.tmp_dir)
|
||||||
|
self.assertEqual(1, len(w))
|
||||||
|
assert issubclass(w[-1].category, DeprecationWarning)
|
||||||
|
assert "group:os-apply-config is deprecated" in str(w[-1].message)
|
||||||
|
@@ -19,12 +19,15 @@ import re
|
|||||||
import shutil
|
import shutil
|
||||||
import six
|
import six
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import warnings
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
|
|
||||||
from tripleo_common import constants
|
from tripleo_common import constants
|
||||||
from tripleo_common import exception
|
|
||||||
|
|
||||||
|
warnings.filterwarnings('once')
|
||||||
|
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
@@ -290,8 +293,10 @@ class Config(object):
|
|||||||
d['scalar'] = True
|
d['scalar'] = True
|
||||||
|
|
||||||
if d['group'] == 'os-apply-config':
|
if d['group'] == 'os-apply-config':
|
||||||
raise exception.GroupOsApplyConfigException(
|
message = ("group:os-apply-config is deprecated. "
|
||||||
d['deployment_name'])
|
"Deployment %s will not be applied by "
|
||||||
|
"config-download." % d['deployment_name'])
|
||||||
|
warnings.warn(message, DeprecationWarning)
|
||||||
|
|
||||||
with open(group_var_server_path, 'w') as f:
|
with open(group_var_server_path, 'w') as f:
|
||||||
f.write(group_var_server_template.render(
|
f.write(group_var_server_template.render(
|
||||||
|
Reference in New Issue
Block a user