Skip to content

Commit

Permalink
Rename stage type env var (#1349)
Browse files Browse the repository at this point in the history
* (trivial) whitespace fix

* Rename stage type env var

The Teletraan stage type is now exposed as an environment variable to
the host.

Rename the env var to match the expected name.
  • Loading branch information
osoriano authored Nov 27, 2023
1 parent 42de350 commit 1672843
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions deploy-agent/deployd/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -105,7 +105,7 @@ def update_variables(self, deploy_status):
if deploy_status.report.stageName:
self._environ['STAGE_NAME'] = deploy_status.report.stageName
if deploy_status.report.stageType:
self._environ['COMPUTE_STAGE_TYPE'] = deploy_status.report.stageType
self._environ['COMPUTE_ENV_TYPE'] = deploy_status.report.stageType
if deploy_status.first_deploy:
self._environ['FIRST_DEPLOY'] = str(deploy_status.first_deploy)
if deploy_status.is_docker:
Expand Down Expand Up @@ -246,7 +246,7 @@ def get_puppet_exit_code_file_path(self):

def get_daemon_sleep_time(self):
return self.get_intvar("daemon_sleep_time", 30)

def get_init_sleep_time(self):
return self.get_intvar("init_sleep_time", 50)

Expand All @@ -269,7 +269,7 @@ def get_facter_name_key(self):

def get_facter_group_key(self):
return self.get_var('agent_group_key', None)

def get_verify_https_certificate(self):
return self.get_var('verify_https_certificate', 'False')

Expand Down
6 changes: 3 additions & 3 deletions deploy-agent/tests/unit/deploy/common/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -55,7 +55,7 @@ def test_get_target(self):
self.assertEqual(os.environ['DEPLOY_ID'], '123')
self.assertEqual(os.environ['ENV_NAME'], 'pinboard')
self.assertEqual(os.environ['STAGE_NAME'], 'beta')
self.assertEqual(os.environ['COMPUTE_STAGE_TYPE'], 'DEFAULT')
self.assertEqual(os.environ['COMPUTE_ENV_TYPE'], 'DEFAULT')
self.assertEqual(self.config.get_target(), '/tmp/pinboard')


Expand Down
4 changes: 2 additions & 2 deletions deploy-sentinel/teletraan/POST_RESTART
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ echo Running POST_RESTART script.
# Environment Variable defined in DeployBoard Script Config
echo $PORT

# Built in Environment Variables
# Built in Environment Variables
echo $ENV_NAME
echo $STAGE_NAME
echo $COMPUTE_STAGE_TYPE
echo $COMPUTE_ENV_TYPE
echo $DEPLOY_ID
echo $DEPLOY_STEP
echo $OPCODE
Expand Down

0 comments on commit 1672843

Please sign in to comment.