On 18-11-2014 06:18, simonjin(a)linux.vnet.ibm.com wrote:
+ def _finish(self, name, success, cb):
+ """Clean up after a migration finished and set the task
finished.
+
+ Arguments:
+ "name": Name of the virtual machine to be migrated.
+ "success": Whether the migration successed or faild and set the tast
+ finish state according to it.
+ "cb": A callback function to signal the Task's progress.
+ """
+ kimchi_log.debug('finished migrate %s' % name)
+ cb('Migrate finished', success)
What's the purpose of the function "_finish"? It only calls
"cb('Migrate
finished', success)", you can run that directly instead of running
"_finish".
General comments:
- There are formatting issues on this patch. Please run "make
check-local" to find and fix them. There are also a few trailing
whitespaces which need to be removed from the code.
- This patch doesn't apply to the latest commit (34ba2f1).
- When I tried to run the code, I got the following error:
127.0.0.1 - - [25/Nov/2014:17:52:49] "POST /vms/landofooo/migrate
HTTP/1.0" 500 929 "" "curl/7.32.0"
[25/Nov/2014:17:53:06] HTTP
Request Headers:
AUTHORIZATION: Basic dmlhbmFjOmNoMW0xbjR6eik=
Content-Length: 87
HOST: 127.0.0.1
CONNECTION: close
Remote-Addr: 127.0.0.1
X-REAL-IP: 127.0.0.1
ACCEPT: application/json
USER-AGENT: curl/7.32.0
X-FORWARDED-FOR: 127.0.0.1
Content-Type: application/json
[25/Nov/2014:17:53:06] HTTP Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line
656, in respond
response.body = self.handler()
File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py",
line 188, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line
34, in __call__
return self.callable(*self.args, **self.kwargs)
File "/home/vianac/LTC/kimchi/src/kimchi/control/base.py", line 104,
in wrapper
action_result = action_fn(*model_args)
File "/home/vianac/LTC/kimchi/src/kimchi/model/vms.py", line 983, in
migrate
destConn = self._getRemoteConn(remoteHost, user, passwd)
File "/home/vianac/LTC/kimchi/src/kimchi/model/vms.py", line 916, in
_getRemoteConn
conn = LibvirtConnection(duri)
NameError: global name 'LibvirtConnection' is not defined