Closed claudiubelu closed 6 years ago
FWIW, this is how it looks now:
>>> vms = conn.Msvm_ComputerSystem()
>>> vms[0]
<pymi_object: \\WIN-SRVR2\root\virtualization\v2:Msvm_ComputerSystem.Name="WIN-SRVR2",CreationClassName="Msvm_ComputerSystem">
>>> print(vms[0])
instance of Msvm_ComputerSystem
{
Caption = "Hosting Computer System";
Description = "Microsoft Hosting Computer System";
ElementName = "WIN-SRVR2";
InstanceID = "None";
CommunicationStatus = None;
DetailedStatus = None;
HealthState = 5;
InstallDate = None;
Name = "WIN-SRVR2";
OperatingStatus = None;
OperationalStatus = (2,);
PrimaryStatus = None;
Status = "OK";
StatusDescriptions = ('OK',);
AvailableRequestedStates = None;
EnabledDefault = 2;
EnabledState = 2;
OtherEnabledState = "None";
RequestedState = 12;
TimeOfLastStateChange = None;
TransitioningToState = None;
CreationClassName = "Msvm_ComputerSystem";
IdentifyingDescriptions = None;
NameFormat = "None";
OtherIdentifyingInfo = None;
PrimaryOwnerContact = "None";
PrimaryOwnerName = "None";
Roles = None;
Dedicated = None;
OtherDedicatedDescriptions = None;
PowerManagementCapabilities = None;
ResetCapability = 1;
EnhancedSessionModeState = None;
FailedOverReplicationType = None;
LastApplicationConsistentReplicationTime = None;
LastReplicationTime = None;
LastReplicationType = None;
LastSuccessfulBackupTime = None;
NumberOfNumaNodes = 1;
OnTimeInMilliseconds = None;
ProcessID = None;
ReplicationHealth = None;
ReplicationMode = None;
ReplicationState = None;
TimeOfLastConfigurationChange = None;
};
>>> vms[0].RequestStateChange
<function RequestStateChange (RequestedState, TimeoutPeriod)>
Works like a charm, why is this not accepted?
Currently, PyMI debugging using PyMI can be a bit difficult, when compared to the old WMI.
For example, the old WMI has an object string representation implementation, meaning that WMI objects can easily and usefully be printed, while PyMI doesn't:
This patch adds a similar str implementation to PyMI.