In the scripting code of getAllClustersInDC, on line 24 you have the following assignment:
cluster = clusterfound;
Here, cluster is of type string, but clusterfound is of type ClusterComputeResource.
Could you try to change this line to something like:
cluster = clusterfound.name;