mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
esx_vi_generator: Simplify generate_helper_header
The function generate_helper_header() only returns a formatted string. This could be achieved without performing string concatenation. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
This commit is contained in:
parent
68106955da
commit
25409b2dd3
@ -1021,20 +1021,16 @@ class ManagedObject(GenericObject):
|
||||
|
||||
|
||||
def generate_helper_header(self):
|
||||
header = ""
|
||||
|
||||
# functions
|
||||
header += ("int esxVI_Lookup%s(esxVI_Context *ctx, "
|
||||
"const char *name, "
|
||||
"esxVI_ManagedObjectReference *root, "
|
||||
"esxVI_String *selectedPropertyNameList, "
|
||||
"esxVI_%s **item, "
|
||||
"esxVI_Occurrence occurrence);\n") \
|
||||
% (self.name, self.name)
|
||||
|
||||
header += "\n"
|
||||
|
||||
return header
|
||||
return (
|
||||
"int esxVI_Lookup%(name)s(esxVI_Context *ctx,"
|
||||
" const char *name,"
|
||||
" esxVI_ManagedObjectReference *root,"
|
||||
" esxVI_String *selectedPropertyNameList,"
|
||||
" esxVI_%(name)s **item,"
|
||||
" esxVI_Occurrence occurrence);\n\n"
|
||||
% {"name": self.name}
|
||||
)
|
||||
|
||||
|
||||
def generate_source(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user