From adcaf171c251df07302ba815875e3c961bed9caa Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 7 May 2024 12:03:59 +0900 Subject: [PATCH] Remove unused template file This removes the template file which was previously used to configure services managed by pacemaker. The configuration support was already removed by 1ced44160bf5220ed65690ca7c3cd932537cca2b and the file is no longer used. Change-Id: I4e63ca5d4ed97a5ccf6dff61267828a3f9ff816b --- templates/ocf_handler.erb | 118 -------------------------------------- 1 file changed, 118 deletions(-) delete mode 100644 templates/ocf_handler.erb diff --git a/templates/ocf_handler.erb b/templates/ocf_handler.erb deleted file mode 100644 index cd22f0d..0000000 --- a/templates/ocf_handler.erb +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/sh -export PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin' -export OCF_ROOT='<%= @ocf_root_path %>' -export OCF_RA_VERSION_MAJOR='1' -export OCF_RA_VERSION_MINOR='0' -export OCF_RESOURCE_INSTANCE='<%= @primitive_name %>' - -# OCF Parameters -<% if @parameters.is_a? Hash -%> - <% @parameters.each do |k,v| -%> - <% v = v.to_s -%> - <% v = v + "'" unless v.end_with? "'" -%> - <% v = "'" + v unless v.start_with? "'" -%> - <%= "export OCF_RESKEY_#{k}=#{v}" %> - <% end -%> -<% end -%> - -help() { -cat< Pacemaker primitive - -Usage: <%= @ocf_handler_name %> [-dh] (action) - -Options: --d - Use set -x to debug the shell script --h - Show this help - -Main actions: -* start -* stop -* monitor -* meta-data -* validate-all - -Multistate: -* promote -* demote -* notify - -Migration: -* migrate_to -* migrate_from - -Optional and unused: -* usage -* help -* status -* reload -* restart -* recover -EOF -} - -red() { - echo -e "\033[31m${1}\033[0m" -} - -green() { - echo -e "\033[32m${1}\033[0m" -} - -blue() { - echo -e "\033[34m${1}\033[0m" -} - -ec2error() { - case "${1}" in - 0) green 'Success' ;; - 1) red 'Error: Generic' ;; - 2) red 'Error: Arguments' ;; - 3) red 'Error: Unimplemented' ;; - 4) red 'Error: Permissions' ;; - 5) red 'Error: Installation' ;; - 6) red 'Error: Configuration' ;; - 7) blue 'Not Running' ;; - 8) green 'Master Running' ;; - 9) red 'Master Failed' ;; - *) red "Unknown" ;; - esac -} - -DEBUG='0' -while getopts ':dh' opt; do - case $opt in - d) - DEBUG='1' - ;; - h) - help - exit 0 - ;; - \?) - echo "Invalid option: -${OPTARG}" >&2 - help - exit 1 - ;; - esac -done - -shift "$((OPTIND - 1))" - -ACTION="${1}" - -# set default action to monitor -if [ "${ACTION}" = '' ]; then - ACTION='monitor' -fi - -if [ "${DEBUG}" = '1' ]; then - bash -x <%= @ocf_script_path %> "${ACTION}" -else - <%= @ocf_script_path %> "${ACTION}" -fi -ec="${?}" - -message="$(ec2error ${ec})" -echo "Exit status: ${message} (${ec})" -exit "${ec}"