Re: [python-win32] How to get a proxy instance of a WMI object.

2011-06-25 Thread Tim Golden
OK: a summary for those who're following the story. I was able to VPN into the OP's setup to get hold of the objects as they come along, so to speak. (Which helped tremendously in trying to see what was going on). The situation is this: When you're setting the attribute of a WMI object (via COM)

Re: [python-win32] How to get a proxy instance of a WMI object.

2011-06-24 Thread Tim Golden
On 24/06/2011 15:29, Tim Golden wrote: The __setattr__ logic does involve a certain level of cacheing and redirection, so there definitely is scope for an error in the WMI code ... and here I mean "in the code of the wmi.py module" ;) TJG ___ python-

Re: [python-win32] How to get a proxy instance of a WMI object.

2011-06-24 Thread Tim Golden
On 24/06/2011 15:09, Graham Bloice wrote: On 24/06/2011 14:59, M Saunders TAS wrote: Graham Bloice wrote: In the Python call to AddVirtualSystemResources() you've reversed the order of the parameters. Additionally the method signature for AddVirtualSystemResources() returns (Job, NewResou

Re: [python-win32] How to get a proxy instance of a WMI object.

2011-06-24 Thread Graham Bloice
On 24/06/2011 14:59, M Saunders TAS wrote: > > Graham Bloice wrote: >> In the Python call to AddVirtualSystemResources() you've reversed the order >> of the parameters. > Additionally the method signature for AddVirtualSystemResources() returns > > (Job, NewResources[], ReturnValue)> > Which is

Re: [python-win32] How to get a proxy instance of a WMI object.

2011-06-24 Thread M Saunders TAS
Tim Golden wrote: > Thanks for posting. Nothing's jumping out at me I'm afraid. I've had another chance to look at this today and have found a workaround using win32com.client but still cannot figure why it exempts when using the WMI module. Using WMI module HD = c.Msvm_ResourceAllocationSett

Re: [python-win32] How to get a proxy instance of a WMI object.

2011-06-22 Thread Tim Golden
On 21/06/2011 21:57, M Saunders TAS wrote: python scsi_add_short.py Traceback (most recent call last): File "scsi_add_short.py", line 15, in HD.Address = "100" File "c:\python27\lib\site-packages\wmi.py", line 571, in __setattr__ handle_com_error () File "c:\python27\lib\site-p

Re: [python-win32] How to get a proxy instance of a WMI object.

2011-06-21 Thread M Saunders TAS
> [... snip horrendous Powershell stuff ...] > > I never can understand why people like Powershell syntax so much Indeed, it is syntactically horrendous. I wrote that after I hit problem in Python to test the concept, honest... > I'm not going to be much help here, I'm afraid: I don't have acce

Re: [python-win32] How to get a proxy instance of a WMI object.

2011-06-21 Thread Tim Golden
On 21/06/2011 17:06, Graham Bloice wrote: In the Python call to AddVirtualSystemResources() you've reversed the order of the parameters. Aha. And to help out the OP, you can pass parameters by name as well as by position. (As you have done in the previous method call). TJG

Re: [python-win32] How to get a proxy instance of a WMI object.

2011-06-21 Thread Graham Bloice
On 21/06/2011 16:13, M Saunders TAS wrote: > Hi, > > I'm trying to use python and the fantastic WMI module to manage Hyper-V > virtual machine resources and am having problems trying to modify properties > of an instance to pass back via WMI. > > The following code in powershell is what I need to

Re: [python-win32] How to get a proxy instance of a WMI object.

2011-06-21 Thread Tim Golden
On 21/06/2011 16:13, M Saunders TAS wrote: I'm trying to use python and the fantastic WMI module to manage Hyper-V virtual machine resources and am having problems trying to modify properties of an instance to pass back via WMI. The following code in powershell is what I need to emulate in pytho

[python-win32] How to get a proxy instance of a WMI object.

2011-06-21 Thread M Saunders TAS
Hi, I'm trying to use python and the fantastic WMI module to manage Hyper-V virtual machine resources and am having problems trying to modify properties of an instance to pass back via WMI. The following code in powershell is what I need to emulate in python: $vmms = gwmi -namespace root\virtu