def _copy_openstack_configuration_to_manager(openstack_config): merged_config = Config().get() Config.update_config(merged_config, openstack_config) tmp = tempfile.mktemp() with open(tmp, 'w') as f: json.dump(merged_config, f) fabric.api.put(tmp, Config.OPENSTACK_CONFIG_PATH_DEFAULT_PATH)
def _copy_openstack_configuration_to_manager(openstack_config): merged_config = Config().get() Config.update_config(merged_config, openstack_config) config_path = ctx.node.properties.get('cloudify').get('plugins').get( 'openstack_config_path') or OPENSTACK_CONFIG_PATH_DEFAULT_PATH tmp = tempfile.mktemp() with open(tmp, 'w') as f: json.dump(merged_config, f) fabric.api.sudo('mkdir -p {0}'.format(os.path.dirname(config_path))) fabric.api.put(tmp, '{0}'.format(config_path), use_sudo=True)