[Libvirt-cim] [PATCH 0 of 2] Camel case to lower case variable name change.

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Fri Dec 4 15:35:29 UTC 2009


Sharad Mishra wrote:
> Kaitlin,
> 
> But when cimtest's vxml.py calls DefineSystem -
> 
> ###########
> service.DefineSystem(SystemSettings=sys_settings,
> ResourceSettings=res_settings,
> ReferenceConfiguration=ref_conf)
> #############
> 
> 
> it passes "res_settings" and these were set in vsms.py as -
> 
> ************
> class CIM_GraphicsResourceAllocationSettingData(CIMClassMOF):
> def __init__(self, name, res_sub_type="vnc", ip=None, ipv6_flag=None,
> lport='-1', keymap="en-us", vnc_passwd=None):
> self.InstanceID = '%s/graphics' %name
> self.ResourceType = RASD_TYPE_GRAPHICS
> 
> if res_sub_type != None:
> self.ResourceSubType = res_sub_type
> 
> if ip != None and lport != None:
> self.Address = '%s:%s' % (ip, lport)
> 
> if ipv6_flag != None:
> self.is_ipv6_only = ipv6_flag

Hi Sharad,

Sorry for being unclear here.

self.IsIPv6Only is correct.  So you should have:

*****************

 > class CIM_GraphicsResourceAllocationSettingData(CIMClassMOF):
 > def __init__(self, name, res_sub_type="vnc", ip=None, ipv6_flag=None,
 > lport='-1', keymap="en-us", vnc_passwd=None):
 > self.InstanceID = '%s/graphics' %name
 > self.ResourceType = RASD_TYPE_GRAPHICS
 >
 > if res_sub_type != None:
 > self.ResourceSubType = res_sub_type
 >
 > if ip != None and lport != None:
 > self.Address = '%s:%s' % (ip, lport)
 >
 > if ipv6_flag != None:
 > self.IsIPv6Only = ipv6_flag

*******************

The camel case I wanted you to remove from the test case was the following:

 >diff -r 45c6da8ca664 -r 75243e330ed7 
 >suites/libvirt-cim/lib/XenKvmLib/vxml.py
 >--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py    Tue Dec 01 16:08:15 
 >2009 -0800
 >+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py    Wed Dec 02 16:13:22 
 >2009 -0800
 >@@ -569,7 +569,7 @@
 >     def __init__(self, virt, dom_name, uuid, pae, acpi, apic, 
 >disk_dev,                   disk_source, net_type, net_name, net_mac, 
 >vcpus, mem,
 >                  mem_allocunits, emu_type, grstype, ip,
 >-                 port_num, kmap, irstype, btype, vnc_passwd):
 >+                 IsIPv6Only, port_num, kmap, irstype, btype, 
 >vnc_passwd):


Just this piece here.  This is the __init__ definition.  So "IsIPv6Only" 
here is simply a parameter name for the __init__ function.  It doesn't 
represent the actual attribute name at this point.  It's just holds a 
value - we can name it whatever.  As all other a parameter names for 
this function are lower case, this one should be as well.

Does this make sense?

> *************
> 
> So the name should change in VSMS.c too.
> 
> Sharad Mishra
> System x Enablement
> Linux Technology Center
> IBM
> 



-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list