@@ -132,13 +132,6 @@ def migrate_records_from_inline_to_remote():
132132 migrate_records (pms_db .inputSetsPMS , yaml_git_config )
133133
134134
135- def disable_git_sync_via_api ():
136- url = "https://localhost:8181/ng/api/git-sync/disable?accountIdentifier=%s&orgIdentifier=%s&projectIdentifier=%s" % (INPUT_ACCOUNT_ID , INPUT_ORG_ID , INPUT_PROJECT_ID )
137- headers = {'x-api-key' : LOCAL_API_KEY }
138- resp = requests .put (url , headers = headers , verify = False )
139- print (resp .status_code )
140-
141-
142135def delete_non_default_pipelines_input_sets ():
143136 pipeline_collection = pms_db .pipelinesPMS
144137 input_sets_collection = pms_db .inputSetsPMS
@@ -168,14 +161,6 @@ def delete_non_default_branch_entities():
168161 delete_non_default_connectors ()
169162
170163
171- def enable_gitx_via_api ():
172- url = "https://localhost:8181/ng/api/git-sync-settings/git-simplification?accountIdentifier=%s&orgIdentifier=%s&projectIdentifier=%s" % (
173- INPUT_ACCOUNT_ID , INPUT_ORG_ID , INPUT_PROJECT_ID )
174- headers = {'x-api-key' : LOCAL_API_KEY }
175- resp = requests .post (url , headers = headers , verify = False )
176- print (resp .status_code )
177-
178-
179164def cleanup_connector_entities ():
180165 collection = ng_manager_db .connectors
181166 for yaml_git_config in yaml_git_config_list :
@@ -244,25 +229,23 @@ def update_triggers():
244229 triggers = pms_db .triggersNG .find (query )
245230
246231 for trigger in triggers :
247- pipelineId = trigger .get (DBKeys .TARGET_IDENTIFIER .value );
232+ pipelineId = trigger .get (DBKeys .TARGET_IDENTIFIER .value )
248233 pipeline = migrated_pipelines [pipelineId ]
249234 if pipeline is None :
250235 continue
251236
252- pipelineBranchName = pipeline [DBKeys .BRANCH .value ];
253- trigger_yaml = yaml .safe_load (trigger .get (DBKeys .YAML .value ));
237+ pipelineBranchName = pipeline [DBKeys .BRANCH .value ]
238+ trigger_yaml = yaml .safe_load (trigger .get (DBKeys .YAML .value ))
254239 trigger_yaml [DBKeys .TRIGGER .value ][DBKeys .PIPELINE_BRANCH_NAME .value ] = pipelineBranchName
255- trigger [DBKeys .YAML .value ] = yaml .dump (trigger_yaml , sort_keys = False );
240+ trigger [DBKeys .YAML .value ] = yaml .dump (trigger_yaml , sort_keys = False )
256241 pms_db .triggersNG .update_one ({"_id" : trigger .get ("_id" )}, {"$set" : trigger }, upsert = False )
257242
258243
259244if __name__ == "__main__" :
260245 setup_mongo_client ()
261246 prepare_yaml_git_config_list ()
262247 delete_yaml_git_configs ()
263- # disable_git_sync_via_api()
264248 delete_non_default_branch_entities ()
265- # enable_gitx_via_api()
266249 enable_new_gitx ()
267250 update_triggers ()
268251 migrate_records_from_inline_to_remote ()
0 commit comments