From 876b4c91b2c5cb0be36f21eb2089abf2e3ca2019 Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Wed, 02 Apr 2008 13:06:05 +0000
Subject: [PATCH] fix:add try/except to avoid exception when getting instance informations
---
opends/tests/system-tests/phases/log/topology.xml | 77 ++++++++++++++++++++++++++++++--------
1 files changed, 60 insertions(+), 17 deletions(-)
diff --git a/opends/tests/system-tests/phases/log/topology.xml b/opends/tests/system-tests/phases/log/topology.xml
index 9b13dbd..20fac0e 100644
--- a/opends/tests/system-tests/phases/log/topology.xml
+++ b/opends/tests/system-tests/phases/log/topology.xml
@@ -115,25 +115,68 @@
<iterate var="a" in="instanceList">
<sequence>
<script>
- str = '\n <id>%s</id>\n' % a.getId()
- str = '%s <host>%s</host>\n' % (str,a.getHost())
- str = '%s <installDir>%s</installDir>\n' % \
- (str,a.getInstallDir())
+ try:
+ str = '\n <id>%s</id>\n' % a.getId()
+ except AttributeError:
+ str = '\n <id>ERROR_id_not_found</id>\n'
+ try:
+ str = '%s <host>%s</host>\n' % (str,a.getHost())
+ except AttributeError:
+ str = '\n <host>ERROR_host_not_found</host>\n'
+ try:
+ str = '%s <installDir>%s</installDir>\n' % \
+ (str,a.getInstallDir())
+ except AttributeError:
+ str = '%s <installDir>ERROR_id_not_found' % str
+ str = '%s</installDir>\n' % str
+
str = '%s <port>\n' % str
- str = '%s <ldap>%s</ldap>\n' % (str,a.getLDAPPort())
- str = '%s <ldaps>%s</ldaps>\n' % (str,a.getLDAPSPort())
- str = '%s <jmx>%s</jmx>\n' % (str,a.getJMXPort())
- str = '%s <replicationServer>%s</replicationServer>\n'%\
- (str,a.getREPLPort())
+
+ try:
+ str = '%s <ldap>%s</ldap>\n' % (str,a.getLDAPPort())
+ except AttributeError:
+ str = '%s <ldap>ERROR_ldap_not_found</ldap>\n' % str
+ try:
+ str = '%s <ldaps>%s</ldaps>\n' % (str,a.getLDAPSPort())
+ except AttributeError:
+ str = '%s <ldaps>ERROR_ldaps_not_found</ldaps>\n' % \
+ str
+ try:
+ str = '%s <jmx>%s</jmx>\n' % (str,a.getJMXPort())
+ except AttributeError:
+ str = '%s <jmx>ERROR_jmx_not_found</jmx>\n' % str
+ try:
+ str = '%s <replicationServer>%s</replicationServer>\n'%\
+ (str,a.getREPLPort())
+ except AttributeError:
+ str = '%s <replicationServerp>' % str
+ str = '%sERROR_replicationServer_not_found' % str
+ str = '%s</replicationServer>\n' % str
+
str = '%s </port>\n' % str
- str = '%s <buildId>%s</buildId>\n' % \
- (str,a.getBuildId())
- str = '%s <jvm>%s</jvm>\n' % \
- (str,a.getJavaVersion())
- str = '%s <os>%s</os>\n' % \
- (str,a.getOs())
- str = '%s <synchroDate>%s</synchroDate>\n' % \
- (str,a.getSynchroDate())
+
+ try:
+ str = '%s <buildId>%s</buildId>\n' % \
+ (str,a.getBuildId())
+ except AttributeError:
+ str = '%s <buildId>ERROR_buildId_not_found' % str
+ str = '%s </buildId>\n' % str
+ try:
+ str = '%s <jvm>%s</jvm>\n' % \
+ (str,a.getJavaVersion())
+ except AttributeError:
+ str = '%s <jvm>ERROR_jvm_not_found</jvm>\n' % str
+ try:
+ str = '%s <os>%s</os>\n' % \
+ (str,a.getOs())
+ except AttributeError:
+ str = '%s <os>ERROR_os_not_found</os>\n' % str
+ try:
+ str = '%s <synchroDate>%s</synchroDate>\n' % \
+ (str,a.getSynchroDate())
+ except AttributeError:
+ str = '%s <synchroDate>ERROR_synchroDate_not_found' % str
+ str = '%s </synchroDate>\n' % str
</script>
<call function="'writeTag'">
--
Gitblit v1.10.0