def phppgadmin_install(): os_version = tools.get_os() if os_version['os'] == 'Linux': if (os_version['version'][0] == 'Ubuntu') or (os_version['version'][0] == 'LinuxMint'): return ubuntu_phppgadmin_install() elif os_version['version'][0] == 'arch': return arch_phppgadmin_install() return False
def apache_restart(): os_version = tools.get_os() if os_version['os'] == 'Linux': if (os_version['version'][0] == 'Ubuntu') or (os_version['version'][0] == 'LinuxMint'): return ubuntu_apache_restart() elif os_version['version'][0] == 'arch': return arch_apache_restart() return False
def _do_install_apache(self): os_version = tools.get_os() if os_version['os'] == 'Linux': if (os_version['version'][0] == 'Ubuntu') or (os_version['version'][0] == 'LinuxMint'): return self._ubuntu_do_install_apache() elif os_version['version'][0] == 'arch': return self._arch_do_install_apache() return False
def odootools_install(install_dir): os_version = tools.get_os() if os_version['os'] == 'Linux': if (os_version['version'][0] == 'Ubuntu') or (os_version['version'][0] == 'LinuxMint'): return ubuntu_odootools_install(install_dir) elif os_version['version'][0] == 'arch': return arch_odootools_install(install_dir) _logger.warning('Can\'t install Odoo Tools in this OS') return False
def git_install(): os_version = tools.get_os() if os_version and os_version['os'] == 'Linux': if (os_version['version'][0] == 'Ubuntu') or (os_version['version'][0] == 'LinuxMint'): return ubuntu_git_install() elif os_version['version'][0] == 'arch': return arch_git_install() _logger.warning('Can\'t install git in this OS (%s)' % os_version['version'][0]) return False
def __init__(self): self._os_info = tools.get_os() self._postgresql_version = '' if self._os_info['os'] == 'Linux' and self._os_info['version'][ 0] == 'Ubuntu': #Support for previous LTS if self._os_info['version'][1] == '12.04': self._postgresql_version = '9.1' #Support for versions between both LTS version elif self._os_info['version'][1] < '14.04': self._postgresql_version = '9.1' #Support for current LTS elif self._os_info['version'][1] == '14.04': self._postgresql_version = '9.3' else: self._postgresql_version = '9.3' #This should fail unsupported version # TODO check versions for Linux Mint and Arch Linux elif self._os_info['os'] == 'Linux' and self._os_info['version'][ 0] == 'LinuxMint': #Support for previous LTS if self._os_info['version'][1] == '13': self._postgresql_version = '9.1' #Support for versions between both LTS version elif self._os_info['version'][1] < '17': self._postgresql_version = '9.1' #Support for current LTS elif self._os_info['version'][1] == '17': self._postgresql_version = '9.3' else: self._postgresql_version = '9.3' #This should fail unsupported version elif self._os_info['os'] == 'Linux' and self._os_info['version'][ 0] == 'arch': self._postgresql_version = '9.1' self._branch = config.params['branch'] or '8.0' installed_branches = [] if os.path.isdir('/etc/openerp/7.0'): installed_branches.append('7.0') if os.path.isdir('/etc/openerp/8.0'): installed_branches.append('8.0') if os.path.isdir('/etc/openerp/trunk'): installed_branches.append('trunk') if len(installed_branches ) == 1 and self._branch not in installed_branches: _logger.debug( 'Selected branch (%s) not installed. Using %s instead.' % (self._branch, installed_branches[0])) self._branch = installed_branches[0] self._name = config.params['name'] self._installation_type = config.params[self._branch+'_'+self._name+'_installation_type'] or \ config.params[self._branch+'_installation_type'] or \ config.params['installation_type'] or 'dev' self._user = config.params[self._branch+'_'+self._name+'_user'] or \ config.params[self._branch+'_user'] or \ config.params['user'] or None self._port = config.params[self._branch+'_'+self._name+'_port'] or \ config.params[self._branch+'_port'] or \ config.params['port'] or 0 if self._branch + '_' + self._name + '_install_odoo_clearcorp' in config.params: self._install_odoo_clearcorp = config.params[ self._branch + '_' + self._name + '_install_odoo_clearcorp'] elif self._branch + '_install_odoo_clearcorp' in config.params: self._install_odoo_clearcorp = config.params[ self._branch + '_install_odoo_clearcorp'] elif 'install_odoo_clearcorp' in config.params: self._install_odoo_clearcorp = config.params[ 'install_odoo_clearcorp'] else: self._install_odoo_clearcorp = True if self._branch + '_' + self._name + '_install_odoo_costa_rica' in config.params: self._install_odoo_costa_rica = config.params[ self._branch + '_' + self._name + '_install_odoo_costa_rica'] elif self._branch + '_install_odoo_costa_rica' in config.params: self._install_odoo_costa_rica = config.params[ self._branch + '_install_odoo_costa_rica'] elif 'install_odoo_costa_rica' in config.params: self._install_odoo_costa_rica = config.params[ 'install_odoo_costa_rica'] else: self._install_odoo_costa_rica = True self._admin_password = config.params[self._branch+'_'+self._name+'_admin_password'] or \ config.params[self._branch+'_admin_password'] or \ config.params['admin_password'] or None self._postgresql_password = config.params[self._branch+'_'+self._name+'_postgresql_password'] or \ config.params[self._branch+'_postgresql_password'] or \ config.params['postgresql_password'] or None if self._branch + '_' + self._name + '_start_now' in config.params: self._start_now = config.params[self._branch + '_' + self._name + '_start_now'] elif self._branch + '_start_now' in config.params: self._start_now = config.params[self._branch + '_start_now'] elif 'start_now' in config.params: self._start_now = config.params['start_now'] elif self._installation_type == 'server': self._start_now = True else: self._start_now = False if self._branch + '_' + self._name + '_on_boot' in config.params: self._on_boot = config.params[self._branch + '_' + self._name + '_on_boot'] elif self._branch + '_on_boot' in config.params: self._on_boot = config.params[self._branch + '_on_boot'] elif 'on_boot' in config.params: self._on_boot = config.params['on_boot'] elif self._installation_type == 'server': self._on_boot = True else: self._on_boot = False self._server = odooServer(instance=self) return super(odooInstance, self).__init__()
def __init__(self, instance=None): self._os_info = tools.get_os() self._postgresql_version = '' if self._os_info['os'] == 'Linux' and self._os_info['version'][ 0] == 'Ubuntu': #Support for previous LTS if self._os_info['version'][1] == '12.04': self._postgresql_version = '9.1' #Support for versions between both LTS version elif self._os_info['version'][1] < '14.04': self._postgresql_version = '9.1' #Support for current LTS elif self._os_info['version'][1] == '14.04': self._postgresql_version = '9.3' else: self._postgresql_version = '9.3' #This should fail unsupported version elif self._os_info['os'] == 'Linux' and self._os_info['version'][ 0] == 'LinuxMint': #Support for previous LTS if self._os_info['version'][1] == '13': self._postgresql_version = '9.1' #Support for versions between both LTS version elif self._os_info['version'][1] < '17': self._postgresql_version = '9.1' #Support for current LTS elif self._os_info['version'][1] == '17': self._postgresql_version = '9.3' else: self._postgresql_version = '9.3' #This should fail unsupported version # TODO check versions for Arch Linux elif self._os_info['os'] == 'Linux' and self._os_info['version'][ 0] == 'arch': self._postgresql_version = '9.1' if instance: _logger.debug('Server initialized with instance: %s' % instance) _logger.debug('Branch: %s' % instance._branch) self._branch = instance._branch else: _logger.debug('Server initialized without instance: %s' % instance) self._branch = config.params['branch'] or '8.0' self._installation_type = config.params[ self._branch + '_installation_type'] or config.params[ 'installation_type'] or 'dev' self._user = config.params[self._branch + '_user'] or config.params['user'] or None if 'install_odoo_clearcorp' in config.params: self._install_odoo_clearcorp = config.params[ 'install_odoo_clearcorp'] elif self._branch + '_install_odoo_clearcorp' in config.params: self._install_odoo_clearcorp = config.params[ self._branch + '_install_odoo_clearcorp'] else: self._install_odoo_clearcorp = True if 'install_odoo_costa_rica' in config.params: self._install_odoo_costa_rica = config.params[ 'install_odoo_costa_rica'] elif self._branch + '_install_odoo_costa_rica' in config.params: self._install_odoo_costa_rica = config.params[ self._branch + '_install_odoo_costa_rica'] else: self._install_odoo_costa_rica = True if self._branch + '_update_postgres_hba' in config.params: self._update_postgres_hba = config.params[self._branch + '_update_postgres_hba'] elif 'update_postgres_hba' in config.params: self._update_postgres_hba = config.params['update_postgres_hba'] else: self._update_postgres_hba = True if self._branch + '_create_postgres_user' in config.params: self._create_postgres_user = config.params[self._branch + '_create_postgres_user'] elif 'create_postgres_user' in config.params: self._create_postgres_user = config.params['create_postgres_user'] else: self._create_postgres_user = True if self._branch + '_install_apache' in config.params: self._install_apache = config.params[self._branch + '_install_apache'] elif 'install_apache' in config.params: self._install_apache = config.params['install_apache'] else: self._install_apache = True self._admin_password = config.params[ self._branch + '_admin_password'] or config.params['admin_password'] or None self._postgresql_password = config.params[ self._branch + '_postgresql_password'] or config.params[ 'postgresql_password'] or None return super(odooServer, self).__init__()