Ravi Nori has posted comments on this change.
Change subject: cli: construct object using factory on update, rather than
fetching live instance
......................................................................
Patch Set 6:
(1 comment)
....................................................
File src/ovirtcli/command/update.py
Line 159: )
Line 160: elif hasattr(resource, 'update'):
Line 161: param_obj = self.create_params_obj()
Line 162: if hasattr(param_obj, 'id'):
Line 163: setattr(param_obj, 'id', getattr(resource, 'id'))
If I dont set id I get the following error when I execute the following cli
command
update vm vm_test1 --cluster-name 'test1b'
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cli/context.py", line 191, in
execute_string
self._execute_command(command)
File "/usr/lib/python2.7/site-packages/cli/context.py", line 386, in
_execute_command
command.run(self)
File "/usr/lib/python2.7/site-packages/cli/command/command.py", line 101, in
run
self.execute()
File "/usr/lib/python2.7/site-packages/ovirtcli/command/update.py", line 167,
in execute
result = self.execute_method(resource_instance, 'update', opts)
File "/usr/lib/python2.7/site-packages/ovirtcli/command/command.py", line
490, in execute_method
result = method(**method_args)
File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/brokers.py",
line 13637, in update
{'{vm:id}': self.get_id()}
File "/usr/lib/python2.7/site-packages/ovirtsdk/utils/urlhelper.py", line 21,
in replace
url = url.replace(k, v)
TypeError: expected a character buffer object
Line 164: resource_class = getattr(brokers,
resource.__class__.__name__)
Line 165: resource_instance = resource_class(param_obj,
resource.context)
Line 166: resource_instance =
self.update_object_data(resource_instance, opts)
Line 167: result = self.execute_method(resource_instance, 'update',
opts)
--
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: 6
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