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:
Radostin Stoyanov 2018-03-20 06:48:49 +00:00 committed by Daniel P. Berrangé
parent 68106955da
commit 25409b2dd3

View File

@ -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):