12-27-2017 12:59 PM
I have this code that when execute all tenants print out line by line including 'Production' but when check for t == 'Production' it is not true
tenants = Tenant.get(session)
for t in tenants:
print t
if t == 'Production': #why this line is never true?
print "TRUE"
Solved! Go to Solution.
02-11-2018 08:52 PM
The instance tenant has an object called name.
So, your code should basically be like this.
tenants = Tenant.get(session)
for t in tenants:
print t
if t.name == 'Production':
print "TRUE"
I hope this helps.
02-11-2018 08:52 PM
The instance tenant has an object called name.
So, your code should basically be like this.
tenants = Tenant.get(session)
for t in tenants:
print t
if t.name == 'Production':
print "TRUE"
I hope this helps.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:
This community is intended for developer topics around Data Center technology and products. If you are looking for a non-developer topic about Data Center, you might find additional information in the Data Center and Cloud community