- for i, attribute in enumerate(attributes):
- # NM interface allows you to pass in a tuple
- # (attribute, default) instead of just an
- # attribute name. default is returned if the
- # attribute is not set.
- if type(attribute) != tuple:
- attribute = (attribute, 0)
- (rc, (value,)) = self.nm.nm_inspect(rspec, [attribute])
- if rc == 0 and value != attribute[1]:
- values[i] = value
- except Exception, err:
- print "Warning: Exception received while querying Node Manager:", err
-
+ (rc, result) = self.nm.nm_inspect(rspec, attributes)
+ if rc == 0 and type(result) == list and len(result) == len(values):
+ values = result