コード例 #1
0
def update_nginx(logger):
    try:
        #importing here because, APIWrapper needs postgres to be setup, so
        #importing at the top results in failure the first time.
        from smart_manager.models import Service
        from storageadmin.models import NetworkConnection
        ip = None
        port = 443
        so = Service.objects.get(name='rockstor')
        if (so.config is not None):
            config = json.loads(so.config)
            port = config['listener_port']
            try:
                ip = NetworkConnection.objects.get(name=config['network_interface']).ipaddr
            except NetworkConnection.DoesNotExist:
                logger.error('Network interface(%s) configured for rockstor '
                             'service does not exist' % config['network_interface'])
                return
        services.update_nginx(ip, port)
    except Exception, e:
        logger.error('Exception occured while trying to update nginx')
        logger.exception(e)
コード例 #2
0
ファイル: initrock.py プロジェクト: rockstor/rockstor-core
def update_nginx(logger):
    try:
        ip, port = current_rockstor_mgmt_ip(logger)
        services.update_nginx(ip, port)
    except Exception as e:
        logger.exception('Exception while updating nginx: {e}'.format(e=e))
コード例 #3
0
ファイル: initrock.py プロジェクト: Psykar/rockstor-core
def update_nginx(logger):
    try:
        ip, port = current_rockstor_mgmt_ip(logger)
        services.update_nginx(ip, port)
    except Exception as e:
        logger.exception('Exception while updating nginx: {e}'.format(e=e))
コード例 #4
0
def restart_rockstor(ip, port):
    services.update_nginx(ip, port)