[PATCH] [Kimchi] Restore control/config.py

This file was wrongly removed by commit 14eefb Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- control/config.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 control/config.py diff --git a/control/config.py b/control/config.py new file mode 100644 index 0000000..15df68f --- /dev/null +++ b/control/config.py @@ -0,0 +1,57 @@ +# +# Project Kimchi +# +# Copyright IBM, Corp. 2013-2014 +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from wok.control.base import Collection, Resource +from wok.control.utils import UrlSubNode + + +@UrlSubNode("config") +class Config(Resource): + def __init__(self, model, id=None): + super(Config, self).__init__(model, id) + self.capabilities = Capabilities(self.model) + self.distros = Distros(model) + + @property + def data(self): + return self.info + + +class Capabilities(Resource): + def __init__(self, model, id=None): + super(Capabilities, self).__init__(model, id) + + @property + def data(self): + return self.info + + +class Distros(Collection): + def __init__(self, model): + super(Distros, self).__init__(model) + self.resource = Distro + + +class Distro(Resource): + def __init__(self, model, ident): + super(Distro, self).__init__(model, ident) + + @property + def data(self): + return self.info -- 2.5.0

Reviewed-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> Tested-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> On 12/02/2015 08:37 PM, Aline Manera wrote:
This file was wrongly removed by commit 14eefb
Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- control/config.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 control/config.py
diff --git a/control/config.py b/control/config.py new file mode 100644 index 0000000..15df68f --- /dev/null +++ b/control/config.py @@ -0,0 +1,57 @@ +# +# Project Kimchi +# +# Copyright IBM, Corp. 2013-2014 +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from wok.control.base import Collection, Resource +from wok.control.utils import UrlSubNode + + +@UrlSubNode("config") +class Config(Resource): + def __init__(self, model, id=None): + super(Config, self).__init__(model, id) + self.capabilities = Capabilities(self.model) + self.distros = Distros(model) + + @property + def data(self): + return self.info + + +class Capabilities(Resource): + def __init__(self, model, id=None): + super(Capabilities, self).__init__(model, id) + + @property + def data(self): + return self.info + + +class Distros(Collection): + def __init__(self, model): + super(Distros, self).__init__(model) + self.resource = Distro + + +class Distro(Resource): + def __init__(self, model, ident): + super(Distro, self).__init__(model, ident) + + @property + def data(self): + return self.info
participants (2)
-
Aline Manera
-
Rodrigo Trujillo