Skip to content

Commit

Permalink
Issue aws#470: Stage feature not functioning as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
Atharva Chauthaiwale authored and stealthycoin committed Aug 14, 2017
1 parent 8313fd0 commit f1bd23f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions chalice/deploy/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
from chalice.constants import DEFAULT_LAMBDA_TIMEOUT
from chalice.constants import DEFAULT_LAMBDA_MEMORY_SIZE
from chalice.constants import MAX_LAMBDA_DEPLOYMENT_SIZE
from chalice.constants import DEFAULT_APIGATEWAY_STAGE_NAME
from chalice.policy import AppPolicyGenerator



NULLARY = Callable[[], str]
OPT_RESOURCES = Optional[DeployedResources]
OPT_STR = Optional[str]
Expand Down Expand Up @@ -804,7 +806,8 @@ def _first_time_deploy(self, config, deployed_resources):
# for each rest API, but that would require injecting chalice stage
# information into the swagger generator.
rest_api_id = self._aws_client.import_rest_api(swagger_doc)
api_gateway_stage = config.api_gateway_stage or DEFAULT_STAGE_NAME
api_gateway_stage = config.api_gateway_stage or \
DEFAULT_APIGATEWAY_STAGE_NAME
self._deploy_api_to_stage(rest_api_id, api_gateway_stage,
deployed_resources)
return rest_api_id, self._aws_client.region_name, api_gateway_stage
Expand All @@ -817,7 +820,8 @@ def _create_resources_for_api(self, config, rest_api_id,
LOGGER.debug("Generating swagger document for rest API.")
swagger_doc = generator.generate_swagger(config.chalice_app)
self._aws_client.update_api_from_swagger(rest_api_id, swagger_doc)
api_gateway_stage = config.api_gateway_stage or DEFAULT_STAGE_NAME
api_gateway_stage = config.api_gateway_stage or \
DEFAULT_APIGATEWAY_STAGE_NAME
self._deploy_api_to_stage(
rest_api_id, api_gateway_stage,
deployed_resources)
Expand Down

0 comments on commit f1bd23f

Please sign in to comment.