<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 12/24/2013 04:26 AM, Mark Wu wrote:<br>
    </div>
    <blockquote cite="mid:52B9290A.7060505@linux.vnet.ibm.com"
      type="cite">On 12/24/2013 02:41 AM, Aline Manera wrote:
      <br>
      <blockquote type="cite">From: Aline Manera
        <a class="moz-txt-link-rfc2396E" href="mailto:alinefm@br.ibm.com">&lt;alinefm@br.ibm.com&gt;</a>
        <br>
        <br>
        VMs(Collection), VM(Resource) and VMScreenshot(Resource) were
        moved to a new -
        <br>
        control/vms.py
        <br>
        That way we can easily know where vm resource is implemented.
        <br>
        <br>
        Signed-off-by: Aline Manera <a class="moz-txt-link-rfc2396E" href="mailto:alinefm@br.ibm.com">&lt;alinefm@br.ibm.com&gt;</a>
        <br>
        ---
        <br>
        &nbsp; Makefile.am&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 1 +
        <br>
        &nbsp; src/kimchi/control/vms.py |&nbsp;&nbsp; 64
        +++++++++++++++++++++++++++++++++++++++++++++
        <br>
        &nbsp; 2 files changed, 65 insertions(+)
        <br>
        &nbsp; create mode 100644 src/kimchi/control/vms.py
        <br>
        <br>
        diff --git a/Makefile.am b/Makefile.am
        <br>
        index 997d4cc..3fda86f 100644
        <br>
        --- a/Makefile.am
        <br>
        +++ b/Makefile.am
        <br>
        @@ -47,6 +47,7 @@ PEP8_WHITELIST = \
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; src/kimchi/server.py \
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; src/kimchi/control/base.py \
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; src/kimchi/control/utils.py \
        <br>
        +&nbsp;&nbsp;&nbsp; src/kimchi/control/vms.py \
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugins/__init__.py \
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugins/sample/__init__.py \
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plugins/sample/model.py \
        <br>
        diff --git a/src/kimchi/control/vms.py
        b/src/kimchi/control/vms.py
        <br>
        new file mode 100644
        <br>
        index 0000000..da960cd
        <br>
        --- /dev/null
        <br>
        +++ b/src/kimchi/control/vms.py
        <br>
        @@ -0,0 +1,64 @@
        <br>
        +#
        <br>
        +# Project Kimchi
        <br>
        +#
        <br>
        +# Copyright IBM, Corp. 2013
        <br>
        +#
        <br>
        +# Authors:
        <br>
        +#&nbsp; Adam Litke <a class="moz-txt-link-rfc2396E" href="mailto:agl@linux.vnet.ibm.com">&lt;agl@linux.vnet.ibm.com&gt;</a>
        <br>
        +#&nbsp; Aline Manera <a class="moz-txt-link-rfc2396E" href="mailto:alinefm@linux.vnet.ibm.com">&lt;alinefm@linux.vnet.ibm.com&gt;</a>
        <br>
        +#
        <br>
        +# This library is free software; you can redistribute it and/or
        <br>
        +# modify it under the terms of the GNU Lesser General Public
        <br>
        +# License as published by the Free Software Foundation; either
        <br>
        +# version 2.1 of the License, or (at your option) any later
        version.
        <br>
        +#
        <br>
        +# This library is distributed in the hope that it will be
        useful,
        <br>
        +# but WITHOUT ANY WARRANTY; without even the implied warranty
        of
        <br>
        +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&nbsp; See the
        GNU
        <br>
        +# Lesser General Public License for more details.
        <br>
        +#
        <br>
        +# You should have received a copy of the GNU Lesser General
        Public
        <br>
        +# License along with this library; if not, write to the Free
        Software
        <br>
        +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
        MA&nbsp; 02110-1301 USA
        <br>
        +
        <br>
        +from kimchi.control.base import Collection, Resource
        <br>
        +from kimchi.control.utils import internal_redirect
        <br>
        +
        <br>
        +
        <br>
        +class VMs(Collection):
        <br>
        +&nbsp;&nbsp;&nbsp; def __init__(self, model):
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super(VMs, self).__init__(model)
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.resource = VM
        <br>
        +
        <br>
        +
        <br>
        +class VM(Resource):
        <br>
        +&nbsp;&nbsp;&nbsp; def __init__(self, model, ident):
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super(VM, self).__init__(model, ident)
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.update_params = ["name"]
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.screenshot = VMScreenShot(model, ident)
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.uri_fmt = '/vms/%s'
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.start = self.generate_action_handler(self,
        'start')
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.stop = self.generate_action_handler(self, 'stop')
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.connect = self.generate_action_handler(self,
        'connect')
        <br>
        +
        <br>
        +&nbsp;&nbsp;&nbsp; @property
        <br>
        +&nbsp;&nbsp;&nbsp; def data(self):
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return {'name': self.ident,
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'uuid': self.info['uuid'],
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'stats': self.info['stats'],
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'memory': self.info['memory'],
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'cpus': self.info['cpus'],
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'state': self.info['state'],
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'screenshot': self.info['screenshot'],
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'icon': self.info['icon'],
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'graphics': {'type':
        self.info['graphics']['type'],
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'port':
        self.info['graphics']['port']}}
        <br>
        +
        <br>
        +
        <br>
        +class VMScreenShot(Resource):
        <br>
        +&nbsp;&nbsp;&nbsp; def __init__(self, model, ident):
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super(VMScreenShot, self).__init__(model, ident)
        <br>
        +
        <br>
        +&nbsp;&nbsp;&nbsp; def get(self):
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.lookup()
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise internal_redirect(self.info)
        <br>
      </blockquote>
      I don't understand why the original code was remained there.
      <br>
    </blockquote>
    <br>
    <font face="DejaVu Sans Mono">I removed the controller.py file in
      the last commit.<br>
      After all changes are done.<br>
    </font>
  </body>
</html>