Project

General

Profile

Bug #7622 » utf8_spaces.patch

François ARMAND, 2015-12-16 14:51

View differences:

techniques/system/common/1.0/minicurl.st
my $program_version = "1.0";
my $program_description = "Perl HTTP, HTTP/S, FTP download and upload tool";
## Argument handling (Getopt)
## Argument handling (Getopt)
my ($get, $put, $httpstatus, $help, $debug, $version, $no_verify);
$get = $put = $httpstatus = $help = $debug = $version = $no_verify = 0;
......
exit(1);
}
# Build the file basename
# Build the file basename
my $file_basename = basename($file);
# Create a HTTP Basic authentication string if applicable
......
# Make sure we use SSLv3 at least while connecting to HTTP/S
$ENV{HTTPS_VERSION} = 3;
# Create a new LWP object
# Create a new LWP object
my $ua = LWP::UserAgent->new;
if($no_verify) {
......
}
if ($put == 1) {
# PUT
# PUT
# Create a variable from the target file
# Create a variable from the target file
my $message;
open(my $fh, '<', $file) or die "ERROR: Unable to open file $file.\n";
{
......
}
close($fh);
# Send the file using the PUT method
# Send the file using the PUT method
if ($authentication eq "") {
$response = $ua->request(PUT $url . $file_basename, Content => $message);
} else {
......
} else {
# GET
# GET
# Get the file using the GET method
# Get the file using the GET method
if ($authentication eq "") {
$response = $ua->request(GET $url);
} else {
techniques/system/common/1.0/promises.st
vars:
# process_term defines how many maximum instances of this
# binary should be running before attempting to SIGTERM them.
# process_kill is the same for SIGKILL.
# binary should be running before attempting to SIGTERM them.
# process_kill is the same for SIGKILL.
!windows::
# On windows, cf-execd is a service, and there can be only one instance of it running (by design)
"process_term[execd]" string => "2";
......
pass3::
"any" usebundle => rudder_common_report("Common", "result_success", "&TRACKINGKEY&", "Process checking", "None", "There is an acceptable number of CFEngine processes running on the machine"),
# Here, I can not use the binaries variable as CFEngine will iterate and output two reports, breaking the reporting.
# Here, I can not use the binaries variable as CFEngine will iterate and output two reports, breaking the reporting.
ifvarclass => "!agent_has_gone_wild.!agent_has_gone_really_wild.!execd_has_gone_wild.!execd_has_gone_really_wild";
"any" usebundle => rudder_common_report("Common", "result_repaired", "&TRACKINGKEY&", "Process checking", "None", "Warning, more than ${process_term[${binaries}]} cf-${binaries} processes were detected. They have been sent a graceful termination signal."),
techniques/system/common/1.0/rudder-groups.st
# 2/ an array "by_uuid" of UUID -> ORIG_NAME, available as a global variable (for example for processing
# all node groups to use in templates)
#
# For example, if node belongs to group: (id: 64f85ba8-39c7-418a-a099-24c2c2909dfd ; name: "Serveurs pre-prod")
# For example, if node belongs to group: (id: 64f85ba8-39c7-418a-a099-24c2c2909dfd ; name: "Serveurs pré-prod")
# we will have the following classes:
# - group_64f85ba8_39c7_418a_a099_24c2c2909dfd
# - group_serveurs_pre_prod
# and vars:
# - "by_uuid[64f85ba8-39c7-418a-a099-24c2c2909dfd]" = "Serveurs pre-prod"
# - "by_uuid[64f85ba8-39c7-418a-a099-24c2c2909dfd]" = "Serveurs pré-prod"
# More over, each value of the array will have an attribute "meta": { "inventory", "attribute_name=rudder_groups" }
#
bundle common rudder_groups {
techniques/system/common/1.0/rudder_agent_nova_cron.st
# Don't forget to remove that file when you're done!
#
# If you want to report a specific message if the Rudder agent fails to restart, please create the
# /opt/rudder/etc/rudder-restart-message.txt file with your custom message inside. It will be sent by mail
# instead of the default one.
# /opt/rudder/etc/rudder-restart-message.txt file with your custom message inside. It will be sent by mail
# instead of the default one.
# Add a decent PATH to the environment before triggering anything
# Add a decent PATH to the environment before triggering anything
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0,5,10,15,20,25,30,35,40,45,50,55 * * * * root . /etc/profile; if [ ! -e ${g.rudder_base}/etc/disable-agent -a `ps -efww | grep -E "(cf-execd|cf-agent)" | grep -E "${sys.workdir}/bin/(cf-execd|cf-agent)" | grep -v grep | wc -l` -eq 0 ]; then ${sys.workdir}/bin/cf-agent -f failsafe.cf >/dev/null 2>\&1 \&\& ${sys.workdir}/bin/cf-agent >/dev/null 2>\&1; if [ $? != 0 ]; then if [ -f /opt/rudder/etc/rudder-restart-message.txt ]; then cat /opt/rudder/etc/rudder-restart-message.txt; else echo "Rudder agent was unable to restart on ${hostname}."; fi; fi; fi
techniques/system/common/1.0/rudder_lib.st
portnumber => "&COMMUNITYPORT&";
}
# This is an evolved version of copy_from scp that uses local copies if we are
# This is an evolved version of copy_from scp that uses local copies if we are
# running on a policy server instead of copying from a localhost remote blindly.
body copy_from rudder_copy_from(from, server,compare,trustkey,preserve,purge) {
techniques/system/common/1.0/site.st
classes:
# Utilities
# Utilities
"gzip_installed" expression => isexecutable("${rudder_gzip}");
"curl_installed" expression => isexecutable("${rudder_curl}");
techniques/system/inventory/1.0/fusionAgent.st
comment => "Sending the inventory to the server";
&if(NOVA)&
# On windows, the this.promiser variable is not evaluated the same way. We are forced to duplicate this block
# On windows, the this.promiser variable is not evaluated the same way. We are forced to duplicate this block
windows::
"${g.rudder_inventories}"
transformer => "${download_command_prefix} \"${this.promiser}\" ${download_command_suffix}",
techniques/system/server-roles/1.0/component-check.st
"index" slist => getindices("service");
# Reporting
# Reporting
"root_integrity_check" slist => { "Check configuration-repository folder", "Check configuration-repository GIT lock" };
"root_password_check_ldap" slist => { "Check LDAP in rudder-webapp.properties", "Check LDAP credentials" };
"root_password_check_psql" slist => { "Check SQL in rudder-webapp.properties", "Check SQL credentials" };
......
# This is to be done only if the package rudder-server-root is present
role_rudder_server_root::
# Password management is expected to be done manually in case of a splitted/relayed installation for now.
# Password management is expected to be done manually in case of a splitted/relayed installation for now.
"any" usebundle => root_password_check_ldap;
"any" usebundle => root_password_check_psql;
"any" usebundle => root_password_check_file;
......
"Check rudder-passwords.conf and pgpass files", "None", "Checking the password files is unnecessary on this machine, skipping..."
);
# Do this if this is the root_server or a relay server
# Do this if this is the root_server or a relay server
root_server|(policy_server.!role_rudder_relay_promises_only)::
"any" usebundle => root_networks_check;
"any" usebundle => root_password_check_dav;
techniques/system/server-roles/1.0/service-check.st
"forced_trigger_${canoname}" expression => strcmp("${force_restart}", "true");
# Raise this class if we are handling a process that should be checked even on
# relay servers.
# Raise this class if we are handling a process that should be checked even on
# relay servers.
"process_exception_on_relay" expression => strcmp("${check_on_relay_server}", "true");
any::
    (1-1/1)