Fix bugs found on version 1.65

parent bfed04da
......@@ -8,7 +8,7 @@
</parent>
<artifactId>MetadataManager</artifactId>
<version>1.63</version>
<version>1.65</version>
<packaging>pom</packaging>
<name>Tango MetadataManager</name>
......
import sys
import httplib, urllib
import json
import sys, traceback
from ParameterDefinition import ParameterDefinition
import logging
......@@ -52,9 +53,14 @@ class ICATParameterReader:
missing = []
# Finding missing parameters
for parameter in list(parameters) + list(labels):
parameterName = ParameterDefinition(parameter).getParameterName()
if parameterName not in parameterTypes:
missing.append(parameterName)
try:
parameterName = ParameterDefinition(parameter).getParameterName()
if parameterName not in parameterTypes:
print("**********--->" + parameterName + " is not in ICAT")
missing.append(parameterName)
except:
print("--->" + parameterName + " got a problem when retrieving the name")
traceback.print_exc(file=sys.stdout)
return self.__getSummary(missing)
def __getSummary(self, missingParameters):
......
......@@ -57,15 +57,18 @@ class ParameterDefinition():
# index is None if absent
for s in r:
m = self.REMOTE_PARAMETER_REG.match(s)
g = m.groups()
# if index is digits, convert to int
try:
g = m.groups()
# if index is digits, convert to int
# list index vs. dict key
# prevents using all digit strings as dict key
if g[1] and g[1].isdigit():
t = g[0], int(g[1])
else:
t = g[0], g[1]
self.remoteList.append(t)
if g[1] and g[1].isdigit():
t = g[0], int(g[1])
else:
t = g[0], g[1]
self.remoteList.append(t)
except:
print("No group found for parameter " + self.parameterName)
def getOriginalString(self):
return self.originalString
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment