Skip to content

Commit 05b951b

Browse files
committed
Automation Toolkit Release v2024.4.2
1 parent 892dc39 commit 05b951b

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

cd3_automation_toolkit/user-scripts/createTenancyConfig.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ def update_devops_config(prefix, repo_ssh_url,files_in_repo,dir_values,devops_us
168168

169169
if not os.path.exists(jenkins_home):
170170
os.mkdir(jenkins_home)
171-
ssh_config_file = jenkins_home + '/git_config'
171+
git_config_file = jenkins_home + '/git_config'
172172

173-
#if /cd3user/.ssh/config file exists
174-
if os.path.exists(ssh_config_file):
175-
f = open(ssh_config_file,"r")
173+
#if git_config_file exists
174+
if os.path.exists(git_config_file):
175+
f = open(git_config_file,"r")
176176
config_file_data = f.read()
177177
f.close()
178178

179179
# new prefix config
180180
if prefix not in config_file_data:
181-
f = open(ssh_config_file,"a")
181+
f = open(git_config_file,"a")
182182
config_file_data = "\n\n" + new_data
183183
f.write(config_file_data)
184184
f.close()
@@ -188,18 +188,18 @@ def update_devops_config(prefix, repo_ssh_url,files_in_repo,dir_values,devops_us
188188

189189
# file doesnot exist
190190
else:
191-
f = open(ssh_config_file, "w")
191+
f = open(git_config_file, "w")
192192
config_file_data = new_data
193193
f.write(config_file_data)
194194
f.close()
195195

196196
#shutil.copyfile(git_config_file, user_ssh_dir + '/config')
197197
# change permissions of private key file and config file for GIT
198198
os.chmod(devops_user_key, 0o600)
199-
os.chmod(ssh_config_file, 0o600)
199+
os.chmod(git_config_file, 0o600)
200200
#os.chmod(git_config_file, 0o600)
201201

202-
'''
202+
203203
# create symlink for Git Config file for SSH operations.
204204
src = git_config_file
205205
if not os.path.exists("/cd3user/.ssh"):
@@ -210,7 +210,6 @@ def update_devops_config(prefix, repo_ssh_url,files_in_repo,dir_values,devops_us
210210
except FileExistsError as e:
211211
os.unlink(dst)
212212
os.symlink(src,dst)
213-
'''
214213

215214
# create jenkins.properties file
216215
jenkins_properties_file_path = jenkins_home+"/jenkins.properties"
@@ -448,8 +447,8 @@ def create_bucket(config, signer):
448447
remote_state = config.get('Default', 'use_remote_state').strip().lower()
449448
remote_state_bucket = config.get('Default', 'remote_state_bucket_name').strip()
450449

451-
use_devops = config.get('Default', 'use_oci_devops_git').strip().strip().lower()
452-
devops_repo = config.get('Default', 'oci_devops_git_repo_name').strip().strip()
450+
use_devops = config.get('Default', 'use_oci_devops_git').strip().lower()
451+
devops_repo = config.get('Default', 'oci_devops_git_repo_name').strip()
453452
devops_user = config.get('Default', 'oci_devops_git_user').strip()
454453
devops_user_key = config.get('Default', 'oci_devops_git_key').strip()
455454

0 commit comments

Comments
 (0)