Hi,
from now, there is a preferred way, how to filter instances and instance names by using a dictionary. The old means of filtering still works, as well.
Examples (with networking provider):
eth0 = cimv2.LMI_IPNetworkConnection.first_instance(key="Name", value="eth0")
vs.
eth0 = cimv2.LMI_IPNetworkConnection.first_instance({"Name" : "eth0"})
The main reason, why we switched to this is: there can be more filter elements present:
active_ifs = cimv2.LMI_IPNetworkConnection.instances({"EnabledDefault" : 2, "OperatingStatus" : 16})
Cheers
On Tue, 2013-06-25 at 14:10 +0200, Peter Hatina wrote:
Hi,
from now, there is a preferred way, how to filter instances and instance names by using a dictionary. The old means of filtering still works, as well.
Examples (with networking provider):
eth0 = cimv2.LMI_IPNetworkConnection.first_instance(key="Name", value="eth0")
vs.
eth0 = cimv2.LMI_IPNetworkConnection.first_instance({"Name" : "eth0"})
The main reason, why we switched to this is: there can be more filter elements present:
active_ifs = cimv2.LMI_IPNetworkConnection.instances({"EnabledDefault" : 2, "OperatingStatus" : 16})
Do we need to use the magic numbers, or can we use something like "OperatingStatus" : on ?
Cheers
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 06/25/2013 09:20 AM, Russell Doty wrote:
On Tue, 2013-06-25 at 14:10 +0200, Peter Hatina wrote:
Hi,
from now, there is a preferred way, how to filter instances and instance names by using a dictionary. The old means of filtering still works, as well.
Examples (with networking provider):
eth0 = cimv2.LMI_IPNetworkConnection.first_instance(key="Name", value="eth0")
vs.
eth0 = cimv2.LMI_IPNetworkConnection.first_instance({"Name" : "eth0"})
The main reason, why we switched to this is: there can be more filter elements present:
active_ifs = cimv2.LMI_IPNetworkConnection.instances({"EnabledDefault" : 2, "OperatingStatus" : 16})
Do we need to use the magic numbers, or can we use something like "OperatingStatus" : on ?
That's a major piece of usability. In the python-world, we probably want this to be represented by something like an enum:
OperatingStatus.ON OperatingStatus.OFF
etc.
Hi,
On 06/25/2013 03:20 PM, Russell Doty wrote:
On Tue, 2013-06-25 at 14:10 +0200, Peter Hatina wrote:
Hi,
from now, there is a preferred way, how to filter instances and instance names by using a dictionary. The old means of filtering still works, as well.
Examples (with networking provider):
eth0 = cimv2.LMI_IPNetworkConnection.first_instance(key="Name", value="eth0")
vs.
eth0 = cimv2.LMI_IPNetworkConnection.first_instance({"Name" : "eth0"})
The main reason, why we switched to this is: there can be more filter elements present:
active_ifs = cimv2.LMI_IPNetworkConnection.instances({"EnabledDefault" : 2, "OperatingStatus" : 16})
Do we need to use the magic numbers, or can we use something like "OperatingStatus" : on ?
It is on a todo list in the track (fedorahosted.org).
Cheers
openlmi-devel mailing list openlmi-devel@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/openlmi-devel
Cheers
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 06/25/2013 09:38 AM, Peter Hatina wrote:
Hi,
On 06/25/2013 03:20 PM, Russell Doty wrote:
On Tue, 2013-06-25 at 14:10 +0200, Peter Hatina wrote:
Hi,
from now, there is a preferred way, how to filter instances and instance names by using a dictionary. The old means of filtering still works, as well.
Examples (with networking provider):
eth0 = cimv2.LMI_IPNetworkConnection.first_instance(key="Name", value="eth0")
vs.
eth0 = cimv2.LMI_IPNetworkConnection.first_instance({"Name" : "eth0"})
The main reason, why we switched to this is: there can be more filter elements present:
active_ifs = cimv2.LMI_IPNetworkConnection.instances({"EnabledDefault" : 2, "OperatingStatus" : 16})
Do we need to use the magic numbers, or can we use something like "OperatingStatus" : on ?
It is on a todo list in the track (fedorahosted.org).
https://fedorahosted.org/openlmi/ticket/100
On Tue, 2013-06-25 at 09:44 -0400, Stephen Gallagher wrote:
On 06/25/2013 09:38 AM, Peter Hatina wrote:
Hi,
On 06/25/2013 03:20 PM, Russell Doty wrote:
On Tue, 2013-06-25 at 14:10 +0200, Peter Hatina wrote:
Hi,
from now, there is a preferred way, how to filter instances and instance names by using a dictionary. The old means of filtering still works, as well.
Examples (with networking provider):
eth0 = cimv2.LMI_IPNetworkConnection.first_instance(key="Name", value="eth0")
vs.
eth0 = cimv2.LMI_IPNetworkConnection.first_instance({"Name" : "eth0"})
The main reason, why we switched to this is: there can be more filter elements present:
active_ifs = cimv2.LMI_IPNetworkConnection.instances({"EnabledDefault" : 2, "OperatingStatus" : 16})
Do we need to use the magic numbers, or can we use something like "OperatingStatus" : on ?
It is on a todo list in the track (fedorahosted.org).
This ticket specifically mentions JobStatus values; will the implementation support every case where magic numbers are used, or is the implementation on a function by function basis?
openlmi-devel mailing list openlmi-devel@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/openlmi-devel
openlmi-devel@lists.stg.fedorahosted.org