Merge "heat.conf options for transport properties default"

This commit is contained in:
Jenkins
2015-03-17 06:47:22 +00:00
committed by Gerrit Code Review
5 changed files with 42 additions and 2 deletions

View File

@@ -156,6 +156,38 @@ engine_opts = [
help=_('Enables engine with convergence architecture. All '
'stacks with this option will be created using '
'convergence engine .')),
cfg.StrOpt('default_software_config_transport',
choices=['POLL_SERVER_CFN',
'POLL_SERVER_HEAT',
'POLL_TEMP_URL'],
default='POLL_SERVER_CFN',
help=_('Template default for how the server should receive the '
'metadata required for software configuration. '
'POLL_SERVER_CFN will allow calls to the cfn API action '
'DescribeStackResource authenticated with the provided '
'keypair (requires enabled heat-api-cfn). '
'POLL_SERVER_HEAT will allow calls to the '
'Heat API resource-show using the provided keystone '
'credentials (requires keystone v3 API, and configured '
'stack_user_* config options). '
'POLL_TEMP_URL will create and populate a '
'Swift TempURL with metadata for polling (requires '
'object-store endpoint which supports TempURL).')),
cfg.StrOpt('default_deployment_signal_transport',
choices=['CFN_SIGNAL',
'TEMP_URL_SIGNAL',
'HEAT_SIGNAL'],
default='CFN_SIGNAL',
help=_('Template default for how the server should signal to '
'heat with the deployment output values. CFN_SIGNAL '
'will allow an HTTP POST to a CFN keypair signed URL '
'(requires enabled heat-api-cfn). '
'TEMP_URL_SIGNAL will create a Swift TempURL to be '
'signaled via HTTP PUT (requires object-store endpoint '
'which supports TempURL). '
'HEAT_SIGNAL will allow calls to the Heat API '
'resource-signal using the provided keystone '
'credentials')),
cfg.StrOpt('onready',
help=_('Deprecated.'))]

View File

@@ -14,6 +14,7 @@
import copy
import uuid
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils
@@ -29,6 +30,9 @@ from heat.engine.resources import signal_responder
from heat.engine import support
from heat.rpc import api as rpc_api
cfg.CONF.import_opt('default_deployment_signal_transport',
'heat.common.config')
LOG = logging.getLogger(__name__)
@@ -152,7 +156,7 @@ class SoftwareDeployment(signal_responder.SignalResponder):
'provided keystone credentials. NO_SIGNAL will result in the '
'resource going to the COMPLETE state without waiting for '
'any signal.'),
default=CFN_SIGNAL,
default=cfg.CONF.default_deployment_signal_transport,
constraints=[
constraints.AllowedValues(SIGNAL_TRANSPORTS),
]

View File

@@ -34,6 +34,7 @@ from heat.engine import support
from heat.rpc import api as rpc_api
cfg.CONF.import_opt('instance_user', 'heat.common.config')
cfg.CONF.import_opt('default_software_config_transport', 'heat.common.config')
LOG = logging.getLogger(__name__)
@@ -285,7 +286,7 @@ class Server(stack_user.StackUser):
'the Heat API resource-show using the provided keystone '
'credentials. POLL_TEMP_URL will create and populate a '
'Swift TempURL with metadata for polling.'),
default=POLL_SERVER_CFN,
default=cfg.CONF.default_software_config_transport,
constraints=[
constraints.AllowedValues(_SOFTWARE_CONFIG_TRANSPORTS),
]

View File

@@ -667,6 +667,8 @@ class ServersTest(common.HeatTestCase):
self.assertEqual('4567', server.access_key)
self.assertEqual('8901', server.secret_key)
self.assertEqual('1234', server._get_user_id())
self.assertEqual('POLL_SERVER_CFN',
server.properties.get('software_config_transport'))
self.assertTrue(stack.access_allowed('4567', 'WebServer'))
self.assertFalse(stack.access_allowed('45678', 'WebServer'))

View File

@@ -148,6 +148,7 @@ class SoftwareDeploymentTest(common.HeatTestCase):
props['user_data_format'] = 'SOFTWARE_CONFIG'
self._create_stack(self.template_with_server)
sd = self.deployment
self.assertEqual('CFN_SIGNAL', sd.properties.get('signal_transport'))
sd.validate()
server = self.stack['server']
self.assertTrue(server.user_data_software_config())