Skip to content

Commit

Permalink
Resolve bug with license, improve some forms, and auto-update backup …
Browse files Browse the repository at this point in the history
…key in shinken
  • Loading branch information
YannickB committed Mar 26, 2015
1 parent 182aad1 commit b31ae5a
Show file tree
Hide file tree
Showing 22 changed files with 77 additions and 40 deletions.
2 changes: 1 addition & 1 deletion __unfinished__/clouder_invoicing/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['base'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder
Expand Down
2 changes: 1 addition & 1 deletion __unfinished__/clouder_template_cas/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Template CAS
Expand Down
2 changes: 1 addition & 1 deletion __unfinished__/clouder_template_git/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['base'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Template Git
Expand Down
2 changes: 1 addition & 1 deletion __unfinished__/clouder_users/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder', 'clouder_template_ldap','ldap_admin'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Users
Expand Down
2 changes: 1 addition & 1 deletion clouder/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['base'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder
Expand Down
50 changes: 30 additions & 20 deletions clouder/clouder_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@
<button name="reset_base" string="Reset from parent" type="object" attrs="{'invisible': [('parent_id','=',False)]}"/>
<newline/>
<field name="public"/>
<newline/>
<field name="partner_id"/>
<field name="partner_ids"/>
</group>
<notebook>
<page string="General">
Expand Down Expand Up @@ -85,6 +83,9 @@
</group>
<button name="save" string="Save" type="object"/>
</page>
<page string="Invoicing">
<field name="partner_ids" colspan="4"/>
</page>
</notebook>
</form>
</field>
Expand Down Expand Up @@ -127,10 +128,9 @@
<newline/>
<field name="parent_id"/>
<button name="deploy_to_parent" string="Deploy to parent" type="object" attrs="{'invisible': [('parent_id','=', False)]}"/>
<field name="public"/>
<newline/>
<field name="public"/>
<field name="partner_id"/>
<field name="partner_ids"/>
</group>
<group col="4" attrs="{'invisible': [('parent_id','!=', False)]}">
<button name="install_formation" string="Install Formation" type="object"/>
Expand All @@ -139,21 +139,28 @@
<field name="sub_service_name"/>
<button name="install_subservice" string="Install Subservice" type="object"/>
</group>
<field name="option_ids" colspan="4">
<tree string="Options" editable="bottom">
<field name="name" domain="[('apptype_id.application_ids.container_ids','in',parent.container_id),('type','=','service')]"/>
<field name="value"/>
</tree>
</field>
<field name="link_ids" colspan="4">
<tree string="Links" editable="bottom">
<field name="name" domain="[('application_id.container_ids','=',parent.container_id),('service','=',True)]"/>
<field name="target" domain="[('application_id.link_target_ids','in',name)]"/>
<button name="deploy_" type="object" string="Reload"/>
</tree>
</field>
<button name="reinstall" string="Reinstall" type="object"/>
<field name="log_ids" colspan="4"/>
<notebook>
<page string="General">
<field name="option_ids" colspan="4">
<tree string="Options" editable="bottom">
<field name="name" domain="[('apptype_id.application_ids.container_ids','in',parent.container_id),('type','=','service')]"/>
<field name="value"/>
</tree>
</field>
<field name="link_ids" colspan="4">
<tree string="Links" editable="bottom">
<field name="name" domain="[('application_id.container_ids','=',parent.container_id),('service','=',True)]"/>
<field name="target" domain="[('application_id.link_target_ids','in',name)]"/>
<button name="deploy_" type="object" string="Reload"/>
</tree>
</field>
<button name="reinstall" string="Reinstall" type="object"/>
<field name="log_ids" colspan="4"/>
</page>
<page string="Invoicing">
<field name="partner_ids" colspan="4"/>
</page>
</notebook>
</form>
</field>
</record>
Expand Down Expand Up @@ -193,9 +200,9 @@
<field name="image_version_id" domain="[('image_id','=',image_id)]"/>
<field name="nosave"/>
<field name="privileged"/>
<newline/>
<field name="public"/>
<field name="partner_id"/>
<field name="partner_ids"/>
</group>
<notebook>
<page string="General">
Expand Down Expand Up @@ -250,6 +257,9 @@
</group>
<button name="save" string="Save" type="object"/>
</page>
<page string="Invoicing">
<field name="partner_ids" colspan="4"/>
</page>
</notebook>


Expand Down
2 changes: 1 addition & 1 deletion clouder_template_bind/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder','clouder_template_shinken'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Template Bind
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_docker/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Template Docker
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_drupal/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder_template_postgres', 'clouder_template_piwik'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'demo': [],
'data': ['clouder_template_drupal_data.xml'],
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_drupal_wikicompare/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder_template_postgres', 'clouder_template_piwik','clouder_template_drupal'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'demo': [],
'data': ['clouder_template_drupal_wikicompare_data.xml'],
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_ldap/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'depends': ['clouder',
'clouder_template_shinken'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Template LDAP
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_mysql/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'depends': ['clouder',
'clouder_template_shinken'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Template MySQL
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_odoo/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
'clouder_template_piwik'
],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Odoo
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_odoo_community/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
'clouder_template_odoo',
],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'demo': [],
'data': [
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_piwik/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder_template_mysql', 'clouder_template_bind', 'clouder_template_proxy', 'clouder_template_shinken'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Template Piwik
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_postfix/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Template Postfix
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_postgres/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'depends': ['clouder',
'clouder_template_shinken'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Template Postgres
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_proxy/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'depends': ['clouder',
'clouder_template_shinken'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Template Proxy
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_seafile/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Seafile
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_shinken/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder_template_postfix'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Shinken
Expand Down
27 changes: 27 additions & 0 deletions clouder_template_shinken/clouder_template_shinken.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,33 @@ def deploy_post(self):
'/usr/local/shinken/etc/hosts/localhost.cfg'])
ssh.close()

@api.multi
def deploy_key(self):
"""
Reset the backup ssh key in shinken containers after we change the
key of a backup container
"""
super(ClouderContainer, self).deploy_key()
if self.application_id.type_id.name == 'backup':
shinkens = {}
containers = self.search([('backup_ids', 'in', self.id)])
for container in containers:
shinken_links = self.env['clouder.container.link'].search([
('container_id','=',container.id),
('name.name.code','=','shinken'),
('target','!=',False)
])
for shinken_link in shinken_links:
shinkens[shinken_link.target.id] = {
'shinken':shinken_link.target,
'container': container
}

for key, shinken in shinkens.iteritems():
ssh = self.connect(shinken['shinken'].fullname,
username='shinken')
send_key_to_shinken(ssh, shinken['container'])
ssh.close()


class ClouderBase(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion clouder_template_wordpress/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'category': 'Clouder',
'depends': ['clouder'],
'author': 'Yannick Buron (Clouder)',
'license': 'LGPL-3 by Clouder',
'license': 'Other OSI approved licence',
'website': 'https://github.com/clouder-community/clouder',
'description': """
Clouder Wordpress
Expand Down

0 comments on commit b31ae5a

Please sign in to comment.