AUTHOR_DN="uid=frank.brehm,ou=People,o=Pixelpark,o=isp"
+WAIT_AFTER_WRITE=0.2
+
#-------------------------------------------------------------------
detect_color() {
usage() {
cat <<-EOF
- Usage: ${BASENAME} [-E|--env ENVIRONMENT] [-s|--simulate] [-d|--debug] [[-v|--verbose] | [-q|--quiet]] [--nocolor]
+ Usage: ${BASENAME} [-E|--env ENVIRONMENT] [-W|--wait SECONDS] [-s|--simulate] [-d|--debug] [[-v|--verbose] | [-q|--quiet]] [--nocolor]
${BASENAME} [-h|--help]
${BASENAME} [-V|--version]
-E|--env|--environment ENVIRONMENT
The LDAP environment to use as the target of this script.
Must be one of '${CYAN}prd${NORMAL}', '${CYAN}test${NORMAL}' or '${CYAN}dev${NORMAL}'. Default: '${CYAN}prod${NORMAL}'."
+ -W|--wait SECONDS
+ Waiting this amount of seconds to ensure replication. Default: ${CYAN}${WAIT_AFTER_WRITE}${NORMAL} seconds.
-s|--simulate Simulation mode, nothing is really done.
-d|--debug Debug output (bash -x).
-v|--verbose Set verbosity on.
get_options() {
local tmp=
- local short_options="E:sdvqhV"
- local long_options="env:,environment:,simulate,debug,verbose,quiet,help,version"
+ local short_options="E:W:sdvqhV"
+ local long_options="env:,environment:,wait:,simulate,debug,verbose,quiet,help,version"
local py_version=
local py_found="n"
local ret=
shift
shift
;;
+ -W|--wait)
+ WAIT_AFTER_WRITE="$2"
+ shift
+ shift
+ ;;
-s|--simulate)
SIMULATE="y"
shift
if [[ "${SIMULATE}" != "y" ]] ; then
eval $cmd
fi
+ sleep "${WAIT_AFTER_WRITE}"
debug "Done."
if [[ "${SIMULATE}" != "y" ]] ; then
eval $cmd
fi
+ sleep "${WAIT_AFTER_WRITE}"
debug "Done."
}
if [[ "${SIMULATE}" != "y" ]] ; then
eval $cmd
fi
+ sleep "${WAIT_AFTER_WRITE}"
debug "Done."
}
if [[ "${SIMULATE}" != "y" ]] ; then
eval $cmd
fi
+ sleep "${WAIT_AFTER_WRITE}"
debug "Done."
}
if [[ "${SIMULATE}" != "y" ]] ; then
eval $cmd
fi
+ sleep "${WAIT_AFTER_WRITE}"
debug "Done."
}
if [[ "${SIMULATE}" != "y" ]] ; then
eval $cmd
fi
+ sleep "${WAIT_AFTER_WRITE}"
debug "Done."
}
if [[ "${SIMULATE}" != "y" ]] ; then
eval $cmd
fi
+ sleep "${WAIT_AFTER_WRITE}"
debug "Done."
}
from fb_tools.config import ConfigError, BaseConfiguration
from fb_tools.xlate import format_list
-__version__ = '0.3.1'
+__version__ = '0.3.2'
LOG = logging.getLogger(__name__)
DEFAULT_ENV = 'prd'
max_tcp_port = (2**16 - 1)
default_xlations_definitions_base = 'xlations.yaml'
max_timeout = 3600
- default_wait_after_write = 0.1
+ default_wait_after_write = 0.2
environments = ('dev', 'test', 'prd')