views:

155

answers:

2

I need to write a couple of python scripts to automate the installation of Microsoft Cluster Ressources.

More specifically, I'll need to query MS Cluster to be able to get a list of ressources with their parameters. And I also need to be able to create resources and set their parameters.

Is someone knows if there is a package/module. Or even some sample scripts using Mark Hammond's pywin32 packages ?

+1  A: 

You can accomplish this using Microsoft COM objects. You can take a look at here on how to start using them.

Lucas S.
It's a start, but I was hoping something of higher level. I'm trying using the makepy utility in pythonwin, but without much success.
Fil
+1  A: 

Ok, I tried it this way.

Via pythonwin, I used the COM Makepy utility. I generated a python interface for MSCluster.Cluster (in order to have a nice introspection in ipython).

Then, localy on my server I do the following:

import win32.client
mscluster = win32.client.Disptach("MSCluster.Cluster")
cluster = mscluster.Open(".")

And I got the following exception:

<class 'pywintypes.com_error'>: 
(-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147023174), None)

If I do:

cluster = mscluster.Open("<insert here cluster name>")

Then I got no error, but cluster is in fact None.

Any advice ?

Fil