diff --git a/sdscli/__init__.py b/sdscli/__init__.py index b2e8122..3a5970b 100644 --- a/sdscli/__init__.py +++ b/sdscli/__init__.py @@ -3,6 +3,6 @@ from __future__ import division from __future__ import absolute_import -__version__ = "1.2.1" +__version__ = "1.2.2" __url__ = "https://github.com/sdskit/sdscli" __description__ = "Command line interface for SDSKit" diff --git a/sdscli/adapters/hysds/fabfile.py b/sdscli/adapters/hysds/fabfile.py index 1d40043..fed7806 100644 --- a/sdscli/adapters/hysds/fabfile.py +++ b/sdscli/adapters/hysds/fabfile.py @@ -476,7 +476,11 @@ def install_base_es_template(): "es_template-base.json", "/tmp/es_template-base.json" ) - run("curl -XPUT 'localhost:9200/_template/index_defaults?pretty' -H 'Content-Type: application/json' -d@/tmp/es_template-base.json") + dir = role + if role == "grq": + dir = "grq2" + with prefix('source %s/bin/activate' % hysds_dir): + run(f'{hysds_dir}/ops/{dir}/scripts/install_base_es_template.sh /tmp/es_template-base.json') def install_es_policy(): diff --git a/sdscli/adapters/hysds/update.py b/sdscli/adapters/hysds/update.py index efd6dfb..fd55079 100644 --- a/sdscli/adapters/hysds/update.py +++ b/sdscli/adapters/hysds/update.py @@ -66,6 +66,13 @@ def update_mozart(conf, ndeps=False, config_only=False, comp='mozart'): execute(fab.npm_install_package_json, '~/mozart/ops/hysds_ui', roles=[comp]) bar.update() + # update celery config + set_bar_desc(bar, 'Updating celery config') + execute(fab.rm_rf, '~/mozart/ops/hysds/celeryconfig.py', roles=[comp]) + execute(fab.rm_rf, '~/mozart/ops/hysds/celeryconfig.pyc', roles=[comp]) + execute(fab.send_celeryconf, 'mozart', roles=[comp]) + bar.update() + # set default ES shard number set_bar_desc(bar, 'Setting default ES shard number') execute(fab.install_base_es_template, roles=[comp]) @@ -86,13 +93,6 @@ def update_mozart(conf, ndeps=False, config_only=False, comp='mozart'): execute(fab.send_logstash_jvm_options, 'mozart', roles=[comp]) bar.update() - # update celery config - set_bar_desc(bar, 'Updating celery config') - execute(fab.rm_rf, '~/mozart/ops/hysds/celeryconfig.py', roles=[comp]) - execute(fab.rm_rf, '~/mozart/ops/hysds/celeryconfig.pyc', roles=[comp]) - execute(fab.send_celeryconf, 'mozart', roles=[comp]) - bar.update() - # update supervisor config set_bar_desc(bar, 'Updating supervisor config') execute(fab.rm_rf, '~/mozart/etc/supervisord.conf', roles=[comp]) @@ -450,11 +450,6 @@ def update_grq(conf, ndeps=False, config_only=False, comp='grq'): '~/sciflo/ops/pele', ndeps, roles=[comp]) bar.update() - # set default ES shard number - set_bar_desc(bar, 'Setting default ES shard number') - execute(fab.install_base_es_template, roles=[comp]) - bar.update() - # update celery config set_bar_desc(bar, 'Updating celery config') execute(fab.rm_rf, '~/sciflo/ops/hysds/celeryconfig.py', roles=[comp]) @@ -468,6 +463,11 @@ def update_grq(conf, ndeps=False, config_only=False, comp='grq'): execute(fab.send_grq2conf, roles=[comp]) bar.update() + # set default ES shard number + set_bar_desc(bar, 'Setting default ES shard number') + execute(fab.install_base_es_template, roles=[comp]) + bar.update() + # update pele config set_bar_desc(bar, 'Updating pele config') execute(fab.rm_rf, '~/sciflo/ops/pele/settings.cfg', roles=[comp])