Skip to content

Commit 3d0acd2

Browse files
committed
Automation Toolkit Release v2024.4.2
1 parent 05b951b commit 3d0acd2

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

cd3_automation_toolkit/user-scripts/createTenancyConfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def update_devops_config(prefix, repo_ssh_url,files_in_repo,dir_values,devops_us
170170
os.mkdir(jenkins_home)
171171
git_config_file = jenkins_home + '/git_config'
172172

173-
#if git_config_file exists
173+
# if /cd3user/tenancies/jenkins_home/git_config file exists
174174
if os.path.exists(git_config_file):
175175
f = open(git_config_file,"r")
176176
config_file_data = f.read()

othertools/oci-fsdr/commonLib.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import re
22
import json
3+
from oci import regions
34

4-
def get_region_from_ocid(ocid, region_map):
5-
match = re.search(r'oc1\.(.*?)\.', ocid)
5+
def get_region_from_ocid(ocid, region_map={}):
6+
region_value = 'unknown-region'
7+
match = re.search(r'oc\d{1,2}.(.*?)\.', ocid)
68
if match:
79
region_code = match.group(1)
8-
return region_map.get(region_code, 'unknown-region')
9-
return 'unknown-region'
10+
if region_code:
11+
# region_code = "phx"/"us-chicago-1"
12+
region_value = regions.get_region_from_short_name(region_code)
13+
return region_value
1014

1115
def load_region_map(region_file):
1216
with open(region_file, 'r') as f:

othertools/oci-fsdr/export_drplan.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
args = parser.parse_args()
1818

1919
try:
20-
region_file = os.path.dirname(os.path.abspath(__file__))+"/region_file.json"
21-
region_map = load_region_map(region_file)
22-
region = get_region_from_ocid(args.ocid, region_map)
20+
#region_file = os.path.dirname(os.path.abspath(__file__))+"/region_file.json"
21+
#region_map = load_region_map(region_file)
22+
#region = get_region_from_ocid(args.ocid, region_map)
23+
region = get_region_from_ocid(args.ocid)
2324
except Exception as e:
2425
print(f"Error loading region map: {str(e)}")
2526
exit(1)

othertools/oci-fsdr/update_drplan.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
args = parser.parse_args()
1616

1717
try:
18-
region_file = os.path.dirname(os.path.abspath(__file__)) + "/region_file.json"
18+
"""region_file = os.path.dirname(os.path.abspath(__file__)) + "/region_file.json"
1919
region_map = load_region_map(region_file)
20-
region = get_region_from_ocid(args.ocid, region_map)
20+
region = get_region_from_ocid(args.ocid, region_map)"""
21+
region = get_region_from_ocid(args.ocid)
2122
except Exception as e:
2223
print(f"Error loading region map or determining region from OCID: {str(e)}")
2324
print(".....Exiting!!!")

0 commit comments

Comments
 (0)