Skip to content

Commit 1205422

Browse files
committed
Update ad_utils.py
1 parent fdf4faa commit 1205422

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib/ad_utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,19 @@ def test_conn():
9090
exit(1)
9191

9292
def gen_script_from_template(entity,template):
93+
dataStatus = 0
94+
if 'dataStatus' in entity['payload'].keys():
95+
dataStatus = entity['payload']['dataStatus']
96+
elif 'dataStatus' in entity['payload']['identity']:
97+
dataStatus = entity['payload']['identity']['dataStatus']
9398
data={
9499
'domain' :u.config('domain'),
95100
'base': u.config('base'),
96101
'dn' : compose_dn(entity),
97102
'path': dn_superior(compose_dn(entity)),
98103
'e': u.make_entry_array(entity),
99104
'config': u.get_config(),
100-
'dataStatus' : entity['payload']['dataStatus']
105+
'dataStatus' : dataStatus
101106
}
102107

103108
environment = jinja2.Environment(loader=FileSystemLoader("../ps1_templates/"))

0 commit comments

Comments
 (0)