@@ -168,17 +168,17 @@ def update_devops_config(prefix, repo_ssh_url,files_in_repo,dir_values,devops_us
168
168
169
169
if not os .path .exists (jenkins_home ):
170
170
os .mkdir (jenkins_home )
171
- ssh_config_file = jenkins_home + '/git_config'
171
+ git_config_file = jenkins_home + '/git_config'
172
172
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" )
176
176
config_file_data = f .read ()
177
177
f .close ()
178
178
179
179
# new prefix config
180
180
if prefix not in config_file_data :
181
- f = open (ssh_config_file ,"a" )
181
+ f = open (git_config_file ,"a" )
182
182
config_file_data = "\n \n " + new_data
183
183
f .write (config_file_data )
184
184
f .close ()
@@ -188,18 +188,18 @@ def update_devops_config(prefix, repo_ssh_url,files_in_repo,dir_values,devops_us
188
188
189
189
# file doesnot exist
190
190
else :
191
- f = open (ssh_config_file , "w" )
191
+ f = open (git_config_file , "w" )
192
192
config_file_data = new_data
193
193
f .write (config_file_data )
194
194
f .close ()
195
195
196
196
#shutil.copyfile(git_config_file, user_ssh_dir + '/config')
197
197
# change permissions of private key file and config file for GIT
198
198
os .chmod (devops_user_key , 0o600 )
199
- os .chmod (ssh_config_file , 0o600 )
199
+ os .chmod (git_config_file , 0o600 )
200
200
#os.chmod(git_config_file, 0o600)
201
201
202
- '''
202
+
203
203
# create symlink for Git Config file for SSH operations.
204
204
src = git_config_file
205
205
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
210
210
except FileExistsError as e :
211
211
os .unlink (dst )
212
212
os .symlink (src ,dst )
213
- '''
214
213
215
214
# create jenkins.properties file
216
215
jenkins_properties_file_path = jenkins_home + "/jenkins.properties"
@@ -448,8 +447,8 @@ def create_bucket(config, signer):
448
447
remote_state = config .get ('Default' , 'use_remote_state' ).strip ().lower ()
449
448
remote_state_bucket = config .get ('Default' , 'remote_state_bucket_name' ).strip ()
450
449
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 ()
453
452
devops_user = config .get ('Default' , 'oci_devops_git_user' ).strip ()
454
453
devops_user_key = config .get ('Default' , 'oci_devops_git_key' ).strip ()
455
454
0 commit comments