diff options
author | 2017-09-12 16:10:29 +0000 | |
---|---|---|
committer | 2017-09-12 16:10:29 +0000 | |
commit | a81d7c6cbdf73572708c152afd9a54590f21e932 (patch) | |
tree | d6a3bed5b5c1b8165d17ae6dea710c37f5052d54 /cdap/cdapplugin | |
parent | 9622da66409485995f1dd388bca406d24a215661 (diff) | |
parent | 81b242147f174fc5d7cc983c36769d029ac1761b (diff) |
Merge "Cleanup after Policy update"
Diffstat (limited to 'cdap/cdapplugin')
-rw-r--r-- | cdap/cdapplugin/cdapcloudify/cdap_plugin.py | 33 | ||||
-rw-r--r-- | cdap/cdapplugin/requirements.txt | 2 | ||||
-rw-r--r-- | cdap/cdapplugin/setup.py | 4 |
3 files changed, 12 insertions, 27 deletions
diff --git a/cdap/cdapplugin/cdapcloudify/cdap_plugin.py b/cdap/cdapplugin/cdapcloudify/cdap_plugin.py index 1de0173..6f4134e 100644 --- a/cdap/cdapplugin/cdapcloudify/cdap_plugin.py +++ b/cdap/cdapplugin/cdapcloudify/cdap_plugin.py @@ -46,15 +46,17 @@ class BadConnections(NonRecoverableError): def _trigger_update(updated_policies): """ Helper function for reconfiguring after a policy update + + updated_policies is assumed to be a list of JSONs that are applicable to the brokers smart interface """ for p in updated_policies: ctx.logger.info("Reconfiguring CDAP application via smart interface") - return discovery.reconfigure_in_broker(cdap_broker_name = ctx.instance.runtime_properties[SELECTED_BROKER], - service_component_name = ctx.instance.runtime_properties[SERVICE_COMPONENT_NAME], - config = p, - reconfiguration_type = "program-flowlet-smart", - logger = ctx.logger) - + return discovery.reconfigure_in_broker( + cdap_broker_name = ctx.instance.runtime_properties[SELECTED_BROKER], + service_component_name = ctx.instance.runtime_properties[SERVICE_COMPONENT_NAME], + config = p, + reconfiguration_type = "program-flowlet-smart", + logger = ctx.logger) def _validate_conns(connections): """ @@ -107,19 +109,6 @@ def _services_calls_iterator(services_calls): for_config[s["config_key"]] = "{{ " + s["service_component_type"] + " }}" #will get bound by CBS return for_config - -###################### -# TEMPORARY!!!!!! -# THIS WILL GO AWAY ONCE ALEX HAS A NODE TYPE AND PLUGIN -###################### -@operation -@Policies.populate_policy_on_node -def policy_get(**kwargs): - """decorate with @Policies.populate_policy_on_node on dcae.policy node to - retrieve the latest policy_body for policy_id property and save it in runtime_properties - """ - pass - ###################### # Cloudify Operations ###################### @@ -252,11 +241,7 @@ def app_smart_reconfigure(new_config_template, **kwargs): """ try: ctx.logger.info("Reconfiguring CDAP application via smart interface") - discovery.reconfigure_in_broker(cdap_broker_name = ctx.instance.runtime_properties[SELECTED_BROKER], - service_component_name = ctx.instance.runtime_properties[SERVICE_COMPONENT_NAME], - config = new_config_template, #This keyname will likely change per policy handler - reconfiguration_type = "program-flowlet-smart", - logger = ctx.logger) + _trigger_update([new_config_template]) except Exception as e: raise NonRecoverableError("CDAP Reconfigure error: {0}".format(e)) diff --git a/cdap/cdapplugin/requirements.txt b/cdap/cdapplugin/requirements.txt index 48ff425..a522688 100644 --- a/cdap/cdapplugin/requirements.txt +++ b/cdap/cdapplugin/requirements.txt @@ -1,3 +1,3 @@ --extra-index-url {{ TODO }}/simple -dcaepolicy==0.0.3 +dcaepolicy==0.0.4 uuid==1.30 diff --git a/cdap/cdapplugin/setup.py b/cdap/cdapplugin/setup.py index 8498473..56e05f4 100644 --- a/cdap/cdapplugin/setup.py +++ b/cdap/cdapplugin/setup.py @@ -22,7 +22,7 @@ from setuptools import setup, find_packages setup( name = "cdapcloudify", - version = "14.2.0", + version = "14.2.1", packages=find_packages(), author = "Tommy Carpenter", author_email = "tommy at research dot eh tee tee dot com", @@ -32,7 +32,7 @@ setup( url = "https://gerrit.onap.org/r/#/admin/projects/dcaegen2/platform/plugins", zip_safe=False, install_requires = [ - "dcaepolicy==0.0.3", + "dcaepolicy==0.0.4", "uuid==1.30" ] ) |