nxshell BulkImport image problems

Started by Andreas@rc, July 22, 2015, 05:52:09 PM

Previous topic - Next topic

Andreas@rc

Hi,

i'm currently working on a nxshell script to import a large number of nodes. This works fine so far, but I have a problem with set the image of the node.

flags = NXCObjectCreationData.CF_DISABLE_NXCP
containerId = 2
name = "Node1"
ip = "0.0.0.0"
node = session.findObjectByName("Node2")

cd = NXCObjectCreationData(objects.GenericObject.OBJECT_NODE, name, containerId);
cd.setCreationFlags(flags);
cd.setPrimaryName(ip)
nodeId = session.createObject(cd)
session.setObjectManaged(nodeId, False)
print '"%s" created (IP: %s)' % (name, ip)

md = NXCObjectModificationData(nodeId)
md.setImage(node.image)
session.modifyObject(md)


Traceback (most recent call last):
  File "<stdin>", line 13, in <module>
TypeError: setImage(): 1st arg can't be coerced to java.util.UUID


The node i'm refering to has an image set and I can print the UUID.
Any ideas why setting images is not working?