#!/usr/bin/env python

from os.path import join, dirname

from cloudify import ctx

ctx.download_resource(join('components', 'utils.py'),
                      join(dirname(__file__), 'utils.py'))
import utils  # NOQA

AMQPINFLUX_SERVICE_NAME = 'amqpinflux'

if utils.is_upgrade:
    utils.validate_upgrade_directories(AMQPINFLUX_SERVICE_NAME)
    utils.systemd.verify_alive(AMQPINFLUX_SERVICE_NAME)
def verify_elasticsearch_running(url):
    """Check that ES is running, and that it contains the provider context.

    This is a sanity check that the manager we're upgrading was bootstrapped
    correctly.
    """
    provider_context_url = urlparse.urljoin(url, 'cloudify_storage/'
                                                 'provider_context/CONTEXT')
    try:
        urllib2.urlopen(provider_context_url)
    except urllib2.URLError as e:
        ctx.abort_operation('ES returned an error when getting the provider '
                            'context: {0}'.format(e))
        raise


if utils.is_upgrade:
    install_properties = utils.ctx_factory.get(ES_SERVICE_NAME)
    ES_ENDPOINT_IP = install_properties['es_endpoint_ip']
    ES_ENDPOINT_PORT = install_properties['es_endpoint_port']
    if not ES_ENDPOINT_IP:
        ES_ENDPOINT_IP = '127.0.0.1'
        utils.systemd.verify_alive(ES_SERVICE_NAME, append_prefix=False)

    elasticsearch_url = 'http://{0}:{1}'.format(ES_ENDPOINT_IP,
                                                ES_ENDPOINT_PORT)

    utils.validate_upgrade_directories(ES_SERVICE_NAME)
    verify_elasticsearch_running(elasticsearch_url)
    verify_properties()
Пример #3
0
#!/usr/bin/env python

from os.path import join, dirname

from cloudify import ctx

ctx.download_resource(join('components', 'utils.py'),
                      join(dirname(__file__), 'utils.py'))
import utils  # NOQA

runtime_props = ctx.instance.runtime_properties

if utils.is_upgrade:
    SERVICE_NAME = runtime_props['service_name']
    utils.validate_upgrade_directories(SERVICE_NAME)
    utils.systemd.verify_alive(SERVICE_NAME)
#!/usr/bin/env python

from os.path import join, dirname

from cloudify import ctx

ctx.download_resource(
    join('components', 'utils.py'),
    join(dirname(__file__), 'utils.py'))
import utils  # NOQA


LOGSTASH_SERVICE_NAME = 'logstash'

if utils.is_upgrade:
    utils.validate_upgrade_directories(LOGSTASH_SERVICE_NAME)
    utils.systemd.verify_alive(LOGSTASH_SERVICE_NAME, append_prefix=False)
Пример #5
0
#!/usr/bin/env python

from os.path import join, dirname

from cloudify import ctx

ctx.download_resource(
    join('components', 'utils.py'),
    join(dirname(__file__), 'utils.py'))
import utils  # NOQA

MGMT_WORKER_SERVICE_NAME = 'mgmtworker'

if utils.is_upgrade:
    utils.validate_upgrade_directories(MGMT_WORKER_SERVICE_NAME)
    utils.systemd.verify_alive(MGMT_WORKER_SERVICE_NAME)
#!/usr/bin/env python

from os.path import join, dirname

from cloudify import ctx

ctx.download_resource(
    join('components', 'utils.py'),
    join(dirname(__file__), 'utils.py'))
import utils  # NOQA

RIEMANN_SERVICE_NAME = 'riemann'

if utils.is_upgrade:
    utils.validate_upgrade_directories(RIEMANN_SERVICE_NAME)
    utils.systemd.verify_alive(RIEMANN_SERVICE_NAME)
#!/usr/bin/env python

from os.path import join, dirname

from cloudify import ctx

ctx.download_resource(
    join('components', 'utils.py'),
    join(dirname(__file__), 'utils.py'))
import utils  # NOQA


RABBITMQ_SERVICE_NAME = 'rabbitmq'

IMMUTABLE_PROPERTIES = [
    'rabbitmq_username',
    'rabbitmq_password',
    'rabbitmq_endpoint_ip',
    'rabbitmq_ssl_enabled',
    'rabbitmq_cert_public',
    'rabbitmq_cert_private'
]

if utils.is_upgrade:
    utils.validate_upgrade_directories(RABBITMQ_SERVICE_NAME)
    utils.verify_immutable_properties(RABBITMQ_SERVICE_NAME,
                                      IMMUTABLE_PROPERTIES)
#!/usr/bin/env python

from os.path import join, dirname

from cloudify import ctx

ctx.download_resource(
    join('components', 'utils.py'),
    join(dirname(__file__), 'utils.py'))
import utils  # NOQA

AMQPINFLUX_SERVICE_NAME = 'amqpinflux'

if utils.is_upgrade:
    utils.validate_upgrade_directories(AMQPINFLUX_SERVICE_NAME)
    utils.systemd.verify_alive(AMQPINFLUX_SERVICE_NAME)
#!/usr/bin/env python

from os.path import join, dirname

from cloudify import ctx

ctx.download_resource(join('components', 'utils.py'),
                      join(dirname(__file__), 'utils.py'))
import utils  # NOQA

LOGSTASH_SERVICE_NAME = 'logstash'

if utils.is_upgrade:
    utils.validate_upgrade_directories(LOGSTASH_SERVICE_NAME)
    utils.systemd.verify_alive(LOGSTASH_SERVICE_NAME, append_prefix=False)
#!/usr/bin/env python

from os.path import join, dirname

from cloudify import ctx

ctx.download_resource(join('components', 'utils.py'),
                      join(dirname(__file__), 'utils.py'))
import utils  # NOQA

RIEMANN_SERVICE_NAME = 'riemann'

if utils.is_upgrade:
    utils.validate_upgrade_directories(RIEMANN_SERVICE_NAME)
    utils.systemd.verify_alive(RIEMANN_SERVICE_NAME)