Michael Pasternak has posted comments on this change.

Change subject: cli: construct object using factory on update, rather than 
fetching live instance
......................................................................


Patch Set 8: Code-Review-1

(2 comments)

....................................................
File src/ovirtcli/command/update.py
Line 160:         elif hasattr(resource, 'update'):
Line 161:             param_obj = self.__create_params_obj(getattr(resource, 
'superclass').__class__.__name__)
Line 162:             if hasattr(param_obj, 'id'):
Line 163:                 setattr(param_obj, 'id', getattr(resource, 'id'))
Line 164:             setattr(resource, 'superclass', param_obj )
please move all this logic to the __create_params_obj():
Line 165:             resource = self.update_object_data(resource, opts)
Line 166:             result = self.execute_method(resource, 'update', opts)
Line 167:         else:
Line 168:             self.error(


Line 174:         """Create an instance of param object."""
Line 175:         params_xml_type = 
ParseHelper.getXmlType(ParseHelper.getXmlTypeInstance(name))
Line 176:         param_obj = None
Line 177:         if params_xml_type:
Line 178:            param_obj = params_xml_type.factory()
please create new instance of the type like this:

type(resource.superclass).factory()
Line 179:         return param_obj
Line 180: 
Line 181:     def show_help(self):
Line 182:         """Show help for "update"."""


-- 
To view, visit http://gerrit.ovirt.org/14557
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I34a910a7f1ecae5385e2a6dcd2297a65f419bc9c
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to