[Kimchi-devel] [project-kimchi] [PATCH 4/4] Remove vnc related code in mockmodel

Mark Wu wudxw at linux.vnet.ibm.com
Wed Dec 18 08:51:21 UTC 2013


We don't need to start a vnc server in mock model because vm's
connect action is removed from REST api.

Signed-off-by: Mark Wu <wudxw at linux.vnet.ibm.com>
---
 src/kimchi/mockmodel.py | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index 4839d4c..4f14024 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -44,7 +44,6 @@ except ImportError:
 import kimchi.model
 from kimchi import config
 from kimchi import network as knetwork
-from kimchi import vnc
 from kimchi.asynctask import AsyncTask
 from kimchi.distroloader import DistroLoader
 from kimchi.exception import InvalidOperation, InvalidParameter
@@ -59,20 +58,8 @@ class MockModel(object):
     def __init__(self, objstore_loc=None):
         self.reset()
         self.objstore = ObjectStore(objstore_loc)
-        self.vnc_port = 5999
         self.distros = self._get_distros()
 
-        # open vnc port
-        # make it here to make sure it will be available on server startup
-        cmd = config.find_qemu_binary()
-        args = [cmd, "-vnc", ":99"]
-
-        cmd  = "ps aux | grep '%s' | grep -v grep" % " ".join(args)
-        proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
-
-        if len(proc.stdout.readlines()) == 0:
-            p = subprocess.Popen(args, close_fds=True)
-
     def get_capabilities(self):
         return {'libvirt_stream_protocols': ['http', 'https', 'ftp', 'ftps', 'tftp'],
                 'qemu_stream': True,
@@ -85,7 +72,6 @@ class MockModel(object):
         self._mock_templates = {}
         self._mock_storagepools = {'default': MockStoragePool('default')}
         self._mock_networks = {'default': MockNetwork('default')}
-        self._mock_graphics_ports = {}
         self._mock_interfaces = self.dummy_interfaces()
         self.next_taskid = 1
         self.storagepool_activate('default')
@@ -121,7 +107,6 @@ class MockModel(object):
             vm.info['screenshot'] = self.vmscreenshot_lookup(name)
         else:
             vm.info['screenshot'] = None
-        vm.info['graphics']['port'] = self._mock_graphics_ports.get(name, None)
         return vm.info
 
     def vm_delete(self, name):
@@ -139,10 +124,6 @@ class MockModel(object):
     def vm_stop(self, name):
         self._get_vm(name).info['state'] = 'shutoff'
 
-    def vm_connect(self, name):
-        vnc_port = kimchi.vnc.new_ws_proxy(self.vnc_port)
-        self._mock_graphics_ports[name] = vnc_port
-
     def vms_create(self, params):
         t_name = kimchi.model.template_name_from_uri(params['template'])
         name = kimchi.model.get_vm_name(params.get('name'), t_name,
-- 
1.8.3.1

-- 
project-kimchi mailing list <project-kimchi at googlegroups.com>
https://groups.google.com/forum/#!forum/project-kimchi
--- 
You received this message because you are subscribed to the Google Groups "project-kimchi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-kimchi+unsubscribe at googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



More information about the Kimchi-devel mailing list