Skip to content

Commit

Permalink
Rename all submodules to clouder
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickB committed Feb 18, 2015
1 parent 1512035 commit 61e1884
Show file tree
Hide file tree
Showing 130 changed files with 843 additions and 919 deletions.
21 changes: 0 additions & 21 deletions README.md

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
##############################################################################

{
'name': 'SaaS Bind',
'name': 'Clouder Bind',
'version': '1.0',
'category': 'Community',
'depends': ['saas'],
'depends': ['clouder'],
'author': 'Yannick Buron',
'license': 'AGPL-3',
'website': 'https://github.com/YannickB',
'description': """
SaaS Bind
Clouder Bind
""",
'demo': [],
'data': ['saas_bind_data.xml'],
'data': ['clouder_bind_data.xml'],
'installable': True,
'application': True,
}
10 changes: 5 additions & 5 deletions saas_ldap/base.py → clouder_template_bind/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
from openerp.osv import fields, osv, orm
from openerp.tools.translate import _

import openerp.addons.saas.execute as execute
import openerp.addons.clouder.execute as execute

import logging
_logger = logging.getLogger(__name__)


class saas_base_link(osv.osv):
_inherit = 'saas.base.link'
class clouder_base_link(osv.osv):
_inherit = 'clouder.base.link'

def deploy_link(self, cr, uid, vals, context={}):
super(saas_base_link, self).deploy_link(cr, uid, vals, context=context)
super(clouder_base_link, self).deploy_link(cr, uid, vals, context=context)
if vals['link_target_app_code'] == 'bind':
ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context)
execute.execute(ssh, ['echo "' + vals['base_name'] + ' IN CNAME ' + ('proxy' in vals['base_links'] and vals['base_links']['proxy']['target']['link_server_domain'] or vals['server_domain']) + '." >> ' + vals['domain_configfile']], context)
Expand All @@ -46,7 +46,7 @@ def deploy_link(self, cr, uid, vals, context={}):
sftp.close()

def purge_link(self, cr, uid, vals, context={}):
super(saas_base_link, self).purge_link(cr, uid, vals, context=context)
super(clouder_base_link, self).purge_link(cr, uid, vals, context=context)
if vals['link_target_app_code'] == 'bind':
ssh, sftp = execute.connect(vals['link_target_container_fullname'], context=context)
execute.execute(ssh, ['sed', '-i', '"/' + vals['base_name'] + '\sIN\sCNAME/d"', vals['domain_configfile']], context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<data>


<record id="apptype_bind" model="saas.application.type">
<record id="apptype_bind" model="clouder.application.type">
<field name="name">bind</field>
<field name="system_user">bind</field>
<field name="admin_name">admin</field>
<field name="admin_email">admin@localhost</field>
<field name="standard_port">53</field>
</record>

<record id="image_bind" model="saas.image">
<record id="image_bind" model="clouder.image">
<field name="name">img_bind</field>
<field name="current_version">1</field>
<field name="dockerfile"><![CDATA[FROM yolobase:latest
Expand Down Expand Up @@ -45,17 +45,17 @@ RUN echo "command=/etc/init.d/bind9 start" >> /etc/supervisor/conf.d/supervisord
USER root
]]></field>
</record>
<record id="image_bind_volume1" model="saas.image.volume">
<record id="image_bind_volume1" model="clouder.image.volume">
<field name="image_id" ref="image_bind"/>
<field name="name">/etc/bind</field>
</record>
<record id="image_bind_port1" model="saas.image.port">
<record id="image_bind_port1" model="clouder.image.port">
<field name="image_id" ref="image_bind"/>
<field name="name">ssh</field>
<field name="localport">22</field>
<field name="expose">internet</field>
</record>
<record id="image_bind_port2" model="saas.image.port">
<record id="image_bind_port2" model="clouder.image.port">
<field name="image_id" ref="image_bind"/>
<field name="name">bind</field>
<field name="localport">53</field>
Expand All @@ -64,7 +64,7 @@ USER root
</record>


<record id="app_bind" model="saas.application">
<record id="app_bind" model="clouder.application">
<field name="name">bind</field>
<field name="code">bind</field>
<field name="current_version">1</field>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
##############################################################################

{
'name': 'SaaS LDAP',
'name': 'Clouder CAS',
'version': '1.0',
'category': 'Community',
'depends': ['saas'],
'depends': ['clouder'],
'author': 'Yannick Buron',
'license': 'AGPL-3',
'website': 'https://github.com/YannickB',
'description': """
SaaS LDAP
Clouder CAS
""",
'demo': [],
'data': ['saas_ldap_data.xml'],
'data': ['clouder_cas_data.xml'],
'installable': True,
'application': True,
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<data>


<record id="apptype_cas" model="saas.application.type">
<record id="apptype_cas" model="clouder.application.type">
<field name="name">cas</field>
<field name="system_user">cas</field>
<field name="admin_name">admin</field>
<field name="admin_email">admin@localhost</field>
<field name="standard_port">389</field>
</record>

<record id="image_cas" model="saas.image">
<record id="image_cas" model="clouder.image">
<field name="name">img_cas</field>
<field name="current_version">1</field>
<field name="parent_id" ref="saas.image_base"/>
<field name="parent_id" ref="clouder.image_base"/>
<field name="dockerfile"><![CDATA[
RUN echo "deb http://http.debian.net/debian squeeze main contrib non-free" >> /etc/apt/sources.list
RUN apt-get update
Expand Down Expand Up @@ -64,17 +64,17 @@ RUN echo "command=/etc/init.d/tomcat6 start" >> /etc/supervisor/conf.d/superviso
]]></field>
</record>
<record id="image_cas_volume1" model="saas.image.volume">
<record id="image_cas_volume1" model="clouder.image.volume">
<field name="image_id" ref="image_cas"/>
<field name="name">/opt/idp-cas/cas</field>
</record>
<record id="image_cas_port1" model="saas.image.port">
<record id="image_cas_port1" model="clouder.image.port">
<field name="image_id" ref="image_cas"/>
<field name="name">ssh</field>
<field name="localport">22</field>
<field name="expose">internet</field>
</record>
<record id="image_cas_port2" model="saas.image.port">
<record id="image_cas_port2" model="clouder.image.port">
<field name="image_id" ref="image_cas"/>
<field name="name">tomcat</field>
<field name="localport">8080</field>
Expand All @@ -83,7 +83,7 @@ RUN echo "command=/etc/init.d/tomcat6 start" >> /etc/supervisor/conf.d/superviso
</record>


<record id="app_cas" model="saas.application">
<record id="app_cas" model="clouder.application">
<field name="name">Cas</field>
<field name="code">cas</field>
<field name="current_version">1</field>
Expand Down
18 changes: 9 additions & 9 deletions saas_cas/deploy.py → clouder_template_cas/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@
import time
from datetime import datetime, timedelta
import subprocess
import openerp.addons.saas.execute as execute
import openerp.addons.clouder.execute as execute
import erppeek

import logging
_logger = logging.getLogger(__name__)



class saas_container(osv.osv):
_inherit = 'saas.container'
class clouder_container(osv.osv):
_inherit = 'clouder.container'

def create_vals(self, cr, uid, vals, context=None):
vals = super(saas_container, self).create_vals(cr, uid, vals, context=context)
vals = super(clouder_container, self).create_vals(cr, uid, vals, context=context)
if 'application_id' in vals and vals['application_id']:
application = self.pool.get('saas.application').browse(cr, uid, vals['application_id'], context=context)
application = self.pool.get('clouder.application').browse(cr, uid, vals['application_id'], context=context)
if application.type_id.name == 'openldap':
if not 'option_ids' in vals:
vals['options_ids'] = []

password_option = self.pool.get('ir.model.data').get_object(cr, uid, 'saas_ldap', 'apptype_openldap_option2').id
password_option = self.pool.get('ir.model.data').get_object(cr, uid, 'clouder_ldap', 'apptype_openldap_option2').id
flag = False
for option in vals['option_ids']:
if option[2]['name'] == password_option:
Expand All @@ -60,8 +60,8 @@ def create_vals(self, cr, uid, vals, context=None):
return vals

def deploy_post(self, cr, uid, vals, context):
super(saas_container, self).deploy_post(cr, uid, vals, context)
context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid})
super(clouder_container, self).deploy_post(cr, uid, vals, context)
context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid})
if vals['apptype_name'] == 'openldap':
ssh, sftp = execute.connect(vals['container_fullname'], context=context)

Expand All @@ -74,7 +74,7 @@ def deploy_post(self, cr, uid, vals, context):
execute.execute(ssh, ['dpkg-reconfigure', '-f', 'noninteractive', 'slapd'], context)

config_file = '/etc/ldap/schema/' + vals['container_options']['domain']['value'] + '.ldif'
sftp.put(modules.get_module_path('saas_ldap') + '/res/ldap.ldif', config_file)
sftp.put(modules.get_module_path('clouder_ldap') + '/res/ldap.ldif', config_file)
domain_dc = ''
for dc in vals['container_options']['domain']['value'].split('.'):
if domain_dc:
Expand Down
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions clouder_template_docker/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Buron
# Copyright 2013 Yannick Buron
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

{
'name': 'Clouder Docker',
'version': '1.0',
'category': 'Community',
'depends': ['clouder'],
'author': 'Yannick Buron',
'license': 'AGPL-3',
'website': 'https://github.com/YannickB',
'description': """
Clouder Docker
""",
'demo': [],
'data': ['clouder_docker_data.xml'],
'installable': True,
'application': True,
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
<data>


<record id="apptype_docker" model="saas.application.type">
<record id="apptype_docker" model="clouder.application.type">
<field name="name">docker</field>
<field name="system_user">docker</field>
<field name="admin_name">admin</field>
<field name="admin_email">admin@localhost</field>
</record>
<record id="apptype_docker_option1" model="saas.application.type.option">
<record id="apptype_docker_option1" model="clouder.application.type.option">
<field name="apptype_id" ref="apptype_docker"/>
<field name="name">start_port</field>
<field name="type">container</field>
</record>
<record id="apptype_docker_option2" model="saas.application.type.option">
<record id="apptype_docker_option2" model="clouder.application.type.option">
<field name="apptype_id" ref="apptype_docker"/>
<field name="name">end_port</field>
<field name="type">container</field>
</record>
<record id="apptype_docker_option3" model="saas.application.type.option">
<record id="apptype_docker_option3" model="clouder.application.type.option">
<field name="apptype_id" ref="apptype_docker"/>
<field name="name">public_key</field>
<field name="type">container</field>
</record>

<record id="image_docker" model="saas.image">
<record id="image_docker" model="clouder.image">
<field name="name">img_docker</field>
<field name="current_version">1</field>
<field name="privileged">True</field>
Expand All @@ -45,11 +45,11 @@ RUN echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/
]]></field>
</record>
<record id="image_docker_volume1" model="saas.image.volume">
<record id="image_docker_volume1" model="clouder.image.volume">
<field name="image_id" ref="image_docker"/>
<field name="name">/var/lib/docker</field>
</record>
<record id="image_docker_port1" model="saas.image.port">
<record id="image_docker_port1" model="clouder.image.port">
<field name="image_id" ref="image_docker"/>
<field name="name">ssh</field>
<field name="localport">22</field>
Expand All @@ -59,7 +59,7 @@ RUN echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/



<record id="app_docker" model="saas.application">
<record id="app_docker" model="clouder.application">
<field name="name">Docker</field>
<field name="code">docker</field>
<field name="current_version">1</field>
Expand Down
16 changes: 8 additions & 8 deletions saas_docker/docker.py → clouder_template_docker/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
_logger = logging.getLogger(__name__)


class saas_container(osv.osv):
_inherit = 'saas.container'
class clouder_container(osv.osv):
_inherit = 'clouder.container'

def write(self, cr, uid, ids, vals, context=None):
res = super(saas_container, self).write(cr, uid, ids, vals, context)
res = super(clouder_container, self).write(cr, uid, ids, vals, context)
for container in self.browse(cr, uid, ids, context=context):
if 'option_ids' in vals:
container_vals = self.get_vals(cr, uid, container.id, context=context)
Expand All @@ -48,12 +48,12 @@ def write(self, cr, uid, ids, vals, context=None):
return res

def create_vals(self, cr, uid, vals, context={}):
super(saas_container, self).create_vals(cr, uid, vals, context)
context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid})
super(clouder_container, self).create_vals(cr, uid, vals, context)
context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid})
if context['apptype_name'] == 'docker':
start_port = ''
end_port = ''
type_option_obj = self.pool.get('saas.application.type.option')
type_option_obj = self.pool.get('clouder.application.type.option')
if 'option_ids' in vals:
_logger.info('test %s', vals['option_ids'])
for option in vals['option_ids']:
Expand Down Expand Up @@ -82,8 +82,8 @@ def create_vals(self, cr, uid, vals, context={}):
return vals

def deploy_post(self, cr, uid, vals, context):
super(saas_container, self).deploy_post(cr, uid, vals, context)
context.update({'saas-self': self, 'saas-cr': cr, 'saas-uid': uid})
super(clouder_container, self).deploy_post(cr, uid, vals, context)
context.update({'clouder-self': self, 'clouder-cr': cr, 'clouder-uid': uid})
if vals['apptype_name'] == 'docker':
if 'public_key' in vals['container_options']:
ssh, sftp = execute.connect(vals['container_fullname'], context=context)
Expand Down
File renamed without changes.
Loading

0 comments on commit 61e1884

Please sign in to comment.